@visactor/vtable 1.5.4-beta.0 → 1.5.4

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 (165) hide show
  1. package/cjs/ListTable.d.ts +0 -2
  2. package/cjs/ListTable.js +3 -2
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +0 -1
  5. package/cjs/PivotChart.js +0 -4
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +0 -2
  8. package/cjs/PivotTable.js +1 -1
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/components/axis/axis.js +2 -3
  11. package/cjs/components/axis/axis.js.map +1 -1
  12. package/cjs/components/legend/discrete-legend/discrete-legend.js +8 -3
  13. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  14. package/cjs/components/react/react-custom-layout.d.ts +3 -1
  15. package/cjs/components/react/react-custom-layout.js +7 -3
  16. package/cjs/components/react/react-custom-layout.js.map +1 -1
  17. package/cjs/core/BaseTable.d.ts +3 -4
  18. package/cjs/core/BaseTable.js +31 -48
  19. package/cjs/core/BaseTable.js.map +1 -1
  20. package/cjs/core/FouseInput.d.ts +0 -1
  21. package/cjs/core/FouseInput.js +2 -5
  22. package/cjs/core/FouseInput.js.map +1 -1
  23. package/cjs/core/tableHelper.d.ts +2 -2
  24. package/cjs/core/tableHelper.js.map +1 -1
  25. package/cjs/core/utils/get-cell-position.d.ts +25 -5
  26. package/cjs/core/utils/get-cell-position.js.map +1 -1
  27. package/cjs/edit/edit-manager.js +4 -7
  28. package/cjs/edit/edit-manager.js.map +1 -1
  29. package/cjs/event/event.js +4 -5
  30. package/cjs/event/event.js.map +1 -1
  31. package/cjs/event/listener/container-dom.js +44 -20
  32. package/cjs/event/listener/container-dom.js.map +1 -1
  33. package/cjs/event/util.js +2 -2
  34. package/cjs/event/util.js.map +1 -1
  35. package/cjs/index.d.ts +1 -1
  36. package/cjs/index.js +1 -1
  37. package/cjs/index.js.map +1 -1
  38. package/cjs/layout/pivot-header-layout.js +1 -0
  39. package/cjs/layout/pivot-header-layout.js.map +1 -1
  40. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
  41. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  42. package/cjs/scenegraph/graphic/chart.d.ts +0 -1
  43. package/cjs/scenegraph/graphic/chart.js +20 -34
  44. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  45. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +32 -28
  46. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  47. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  48. package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
  49. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  50. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  51. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  52. package/cjs/scenegraph/layout/update-height.js +1 -1
  53. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  54. package/cjs/scenegraph/layout/update-width.js +1 -1
  55. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  56. package/cjs/scenegraph/refresh-node/update-chart.d.ts +2 -2
  57. package/cjs/scenegraph/refresh-node/update-chart.js +17 -10
  58. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  59. package/cjs/scenegraph/scenegraph.d.ts +2 -1
  60. package/cjs/scenegraph/scenegraph.js +15 -16
  61. package/cjs/scenegraph/scenegraph.js.map +1 -1
  62. package/cjs/scenegraph/select/create-select-border.js +2 -2
  63. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  64. package/cjs/scenegraph/utils/text-icon-layout.js +6 -5
  65. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  66. package/cjs/state/cell-move/index.js +14 -11
  67. package/cjs/state/cell-move/index.js.map +1 -1
  68. package/cjs/state/select/is-cell-select-highlight.js +6 -0
  69. package/cjs/state/select/is-cell-select-highlight.js.map +1 -1
  70. package/cjs/state/state.js +8 -6
  71. package/cjs/state/state.js.map +1 -1
  72. package/cjs/themes/theme.js +8 -0
  73. package/cjs/themes/theme.js.map +1 -1
  74. package/cjs/tools/helper.js.map +1 -1
  75. package/cjs/ts-types/base-table.d.ts +4 -13
  76. package/cjs/ts-types/base-table.js.map +1 -1
  77. package/cjs/ts-types/table-engine.d.ts +2 -1
  78. package/cjs/ts-types/table-engine.js.map +1 -1
  79. package/cjs/ts-types/theme.d.ts +2 -0
  80. package/cjs/ts-types/theme.js.map +1 -1
  81. package/cjs/vrender.js.map +1 -1
  82. package/dist/vtable.js +327 -328
  83. package/dist/vtable.min.js +2 -2
  84. package/es/ListTable.d.ts +0 -2
  85. package/es/ListTable.js +3 -2
  86. package/es/ListTable.js.map +1 -1
  87. package/es/PivotChart.d.ts +0 -1
  88. package/es/PivotChart.js +2 -5
  89. package/es/PivotChart.js.map +1 -1
  90. package/es/PivotTable.d.ts +0 -2
  91. package/es/PivotTable.js +1 -1
  92. package/es/PivotTable.js.map +1 -1
  93. package/es/components/axis/axis.js +1 -3
  94. package/es/components/axis/axis.js.map +1 -1
  95. package/es/components/legend/discrete-legend/discrete-legend.js +8 -3
  96. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  97. package/es/components/react/react-custom-layout.d.ts +3 -1
  98. package/es/components/react/react-custom-layout.js +7 -3
  99. package/es/components/react/react-custom-layout.js.map +1 -1
  100. package/es/core/BaseTable.d.ts +3 -4
  101. package/es/core/BaseTable.js +30 -47
  102. package/es/core/BaseTable.js.map +1 -1
  103. package/es/core/FouseInput.d.ts +0 -1
  104. package/es/core/FouseInput.js +2 -5
  105. package/es/core/FouseInput.js.map +1 -1
  106. package/es/core/tableHelper.d.ts +2 -2
  107. package/es/core/tableHelper.js.map +1 -1
  108. package/es/core/utils/get-cell-position.d.ts +25 -5
  109. package/es/core/utils/get-cell-position.js.map +1 -1
  110. package/es/edit/edit-manager.js +4 -7
  111. package/es/edit/edit-manager.js.map +1 -1
  112. package/es/event/event.js +4 -5
  113. package/es/event/event.js.map +1 -1
  114. package/es/event/listener/container-dom.js +40 -19
  115. package/es/event/listener/container-dom.js.map +1 -1
  116. package/es/event/util.js +2 -2
  117. package/es/event/util.js.map +1 -1
  118. package/es/index.d.ts +1 -1
  119. package/es/index.js +1 -1
  120. package/es/index.js.map +1 -1
  121. package/es/layout/pivot-header-layout.js +1 -0
  122. package/es/layout/pivot-header-layout.js.map +1 -1
  123. package/es/scenegraph/debug-tool/debug-tool.js +1 -4
  124. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  125. package/es/scenegraph/graphic/chart.d.ts +0 -1
  126. package/es/scenegraph/graphic/chart.js +21 -33
  127. package/es/scenegraph/graphic/chart.js.map +1 -1
  128. package/es/scenegraph/graphic/contributions/chart-render-helper.js +32 -28
  129. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  130. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  131. package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
  132. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  133. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  134. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  135. package/es/scenegraph/layout/update-height.js +1 -1
  136. package/es/scenegraph/layout/update-height.js.map +1 -1
  137. package/es/scenegraph/layout/update-width.js +1 -1
  138. package/es/scenegraph/layout/update-width.js.map +1 -1
  139. package/es/scenegraph/refresh-node/update-chart.d.ts +2 -2
  140. package/es/scenegraph/refresh-node/update-chart.js +14 -7
  141. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  142. package/es/scenegraph/scenegraph.d.ts +2 -1
  143. package/es/scenegraph/scenegraph.js +16 -17
  144. package/es/scenegraph/scenegraph.js.map +1 -1
  145. package/es/scenegraph/select/create-select-border.js +2 -2
  146. package/es/scenegraph/select/create-select-border.js.map +1 -1
  147. package/es/scenegraph/utils/text-icon-layout.js +7 -4
  148. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  149. package/es/state/cell-move/index.js +14 -11
  150. package/es/state/cell-move/index.js.map +1 -1
  151. package/es/state/select/is-cell-select-highlight.js +6 -0
  152. package/es/state/select/is-cell-select-highlight.js.map +1 -1
  153. package/es/state/state.js +8 -6
  154. package/es/state/state.js.map +1 -1
  155. package/es/themes/theme.js +8 -0
  156. package/es/themes/theme.js.map +1 -1
  157. package/es/tools/helper.js.map +1 -1
  158. package/es/ts-types/base-table.d.ts +4 -13
  159. package/es/ts-types/base-table.js.map +1 -1
  160. package/es/ts-types/table-engine.d.ts +2 -1
  161. package/es/ts-types/table-engine.js.map +1 -1
  162. package/es/ts-types/theme.d.ts +2 -0
  163. package/es/ts-types/theme.js.map +1 -1
  164. package/es/vrender.js.map +1 -1
  165. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/graphic/contributions/chart-render.ts"],"names":[],"mappings":";;;;;;AAUA,OAAO,EAEL,QAAQ,EAIR,UAAU,EAEV,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAGtE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,UAAiB;IAAxD;;QAEL,eAAU,GAAW,iBAAiB,CAAC;IAiLzC,CAAC;IA/KC,SAAS,CACP,KAAY,EACZ,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;gBACD,MAAA,mBAAmB,CAAC,kBAAkB,oEAAG,SAAS,CAAC,CAAC;aACrD;SAGF;aAAM;YACL,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE;gBACxC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;oBAC7E,eAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;oBAChE,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAClC;gBAED,IAAI,CAAC,oBAAoB,EAAE,EAAE;oBAC3B,qBAAqB,CAAC,KAAK,CAAC,CAAC;iBAC9B;aACF;iBAAM;gBACL,WAAW,CAAC,KAAK,CAAC,CAAC;aACpB;SACF;IACH,CAAC;IAwCD,IAAI,CAAC,KAAY,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QAE5G,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF,CAAA;AAnLY,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CAmLpC;SAnLY,wBAAwB","file":"chart-render.js","sourcesContent":["import type {\n IGraphicAttribute,\n IContext2d,\n IDrawContext,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IRenderService,\n IThemeAttribute\n} from './../../../vrender';\nimport {\n ContributionProvider,\n getTheme,\n IGroupRenderContribution,\n createImage,\n inject,\n injectable,\n named,\n BaseRender\n} from './../../../vrender';\nimport type { Chart } from '../chart';\nimport { CHART_NUMBER_TYPE } from '../chart';\nimport {\n IsHandlingChartQueue,\n chartRenderKeys,\n chartRenderQueueList,\n renderChart,\n startRenderChartQueue\n} from './chart-render-helper';\nimport { isArray } from '@visactor/vutils';\n\nexport const ChartRender = Symbol.for('ChartRender');\nexport const ChartRenderContribution = Symbol.for('ChartRenderContribution');\n\n@injectable()\nexport class DefaultCanvasChartRender extends BaseRender<Chart> implements IGraphicRender {\n type: 'chart';\n numberType: number = CHART_NUMBER_TYPE;\n\n drawShape(\n chart: Chart,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // console.log(chart.parent.col, chart.parent.row);\n // if (chart.parent.col !== 2 || chart.parent.row !== 2) {\n // return;\n // }\n const groupAttribute = getTheme(chart, params?.theme).group;\n\n const { dataId, data, spec } = chart.attribute;\n const viewBox = chart.getViewBox();\n const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;\n const { table } = chart.getRootNode() as any;\n\n const { active, cacheCanvas, activeChartInstance } = chart;\n // console.log('render chart', chart.parent.col, chart.parent.row, viewBox, cacheCanvas);\n if (!active && cacheCanvas) {\n if (isArray(cacheCanvas)) {\n cacheCanvas.forEach(singleCacheCanvas => {\n const { x, y, width, height, canvas } = singleCacheCanvas;\n context.drawImage(canvas, x, y, width, height);\n });\n } else {\n context.drawImage(cacheCanvas, x, y, width, height);\n }\n } else if (activeChartInstance) {\n if (table.options.specFormat) {\n const formatResult = table.options.specFormat(chart.attribute.spec);\n if (formatResult.needFormatSpec && formatResult.spec) {\n const spec = formatResult.spec;\n activeChartInstance.updateSpecSync(spec);\n return;\n }\n }\n\n const viewBox = chart.getViewBox();\n activeChartInstance.updateViewBox(\n // {\n // x1: viewBox.x1 - (chart.getRootNode() as any).table.scrollLeft,\n // x2: viewBox.x2 - (chart.getRootNode() as any).table.scrollLeft,\n // y1: viewBox.y1 - (chart.getRootNode() as any).table.scrollTop,\n // y2: viewBox.y2 - (chart.getRootNode() as any).table.scrollTop\n // },\n {\n x1: 0,\n x2: viewBox.x2 - viewBox.x1,\n y1: 0,\n y2: viewBox.y2 - viewBox.y1\n },\n false,\n false\n );\n // console.log(viewBox);\n\n const chartStage = activeChartInstance.getStage();\n chartStage.needRender = true;\n // chartStage.background = 'red';\n const matrix = chart.globalTransMatrix.clone();\n const stageMatrix = chart.stage.window.getViewBoxTransform().clone();\n // matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);\n stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);\n chartStage.window.setViewBoxTransform(\n stageMatrix.a,\n stageMatrix.b,\n stageMatrix.c,\n stageMatrix.d,\n stageMatrix.e,\n stageMatrix.f\n );\n\n if (typeof dataId === 'string') {\n activeChartInstance.updateDataSync(dataId, data ?? []);\n } else {\n const dataBatch = [];\n // 如果是组合图有series系列 需要组个设置数据 这里的data包括的单元格完整数据 需要根据key过滤\n for (const dataIdStr in dataId) {\n const dataIdAndField = dataId[dataIdStr];\n const series = spec.series.find((item: any) => item?.data?.id === dataIdStr);\n dataBatch.push({\n id: dataIdStr,\n values: dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? [],\n fields: series?.data?.fields\n });\n if (!activeChartInstance.updateFullDataSync) {\n activeChartInstance.updateDataSync(\n dataIdStr,\n dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? []\n );\n }\n }\n activeChartInstance.updateFullDataSync?.(dataBatch);\n }\n // debugger;\n // console.log(drawContext.context.canvas.toDataURL());\n } else {\n if (table.internalProps.renderChartAsync) {\n if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {\n chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);\n chartRenderQueueList.push(chart);\n }\n //判断是否已经开启渲染队列\n if (!IsHandlingChartQueue()) {\n startRenderChartQueue(table);\n }\n } else {\n renderChart(chart);\n }\n }\n }\n\n // draw(chart: Chart, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // const { context } = drawContext;\n // if (!context) {\n // return;\n // }\n // // debugger;\n // const { clip } = chart.attribute;\n // if (clip) {\n // context.save();\n // } else {\n // context.highPerformanceSave();\n // }\n // // group直接transform\n // context.transformFromMatrix(chart.transMatrix, true);\n\n // context.beginPath();\n // // 如果跳过绘制,那就不绘制\n // if (params.skipDraw) {\n // this.drawShape(\n // chart,\n // context,\n // 0,\n // 0,\n // drawContext,\n // params,\n // () => false,\n // () => false\n // );\n // } else {\n // this.drawShape(chart, context, 0, 0, drawContext);\n // }\n\n // if (clip) {\n // context.restore();\n // } else {\n // context.highPerformanceRestore();\n // }\n // }\n draw(chart: Chart, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // const circleAttribute = getTheme(circle, params?.theme).circle;\n this._draw(chart, {} as any, false, drawContext, params);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/graphic/contributions/chart-render.ts"],"names":[],"mappings":";;;;;;AAUA,OAAO,EAEL,QAAQ,EAIR,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CA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EACD,CAAC,EACD,WAAW,EACX,MAAM,EACN,GAAG,EAAE,CAAC,KAAK,EACX,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;SACH;aAAM;YACL,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;SACnD;QAED,IAAI,IAAI,EAAE;YACR,OAAO,CAAC,OAAO,EAAE,CAAC;SACnB;aAAM;YACL,OAAO,CAAC,sBAAsB,EAAE,CAAC;SAClC;IACH,CAAC;CACF,CAAA;AA5HY,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CA4HpC;SA5HY,wBAAwB","file":"chart-render.js","sourcesContent":["import type {\n IGraphicAttribute,\n IContext2d,\n IDrawContext,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IRenderService,\n IThemeAttribute\n} from './../../../vrender';\nimport {\n ContributionProvider,\n getTheme,\n IGroupRenderContribution,\n createImage,\n inject,\n injectable,\n named\n} from './../../../vrender';\nimport type { Chart } from '../chart';\nimport { CHART_NUMBER_TYPE } from '../chart';\nimport {\n IsHandlingChartQueue,\n chartRenderKeys,\n chartRenderQueueList,\n renderChart,\n startRenderChartQueue\n} from './chart-render-helper';\nimport { isArray } from '@visactor/vutils';\n\nexport const ChartRender = Symbol.for('ChartRender');\nexport const ChartRenderContribution = Symbol.for('ChartRenderContribution');\n\n@injectable()\nexport class DefaultCanvasChartRender implements IGraphicRender {\n type: 'chart';\n numberType: number = CHART_NUMBER_TYPE;\n\n drawShape(\n chart: Chart,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const groupAttribute = getTheme(chart, params?.theme).group;\n\n const { dataId, data, spec } = chart.attribute;\n const viewBox = chart.getViewBox();\n const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;\n\n const { active, cacheCanvas, activeChartInstance } = chart;\n // console.log('render chart', chart.parent.col, chart.parent.row, viewBox, cacheCanvas);\n if (!active && cacheCanvas) {\n if (isArray(cacheCanvas)) {\n cacheCanvas.forEach(singleCacheCanvas => {\n const { x, y, width, height, canvas } = singleCacheCanvas;\n context.drawImage(canvas, x, y, width, height);\n });\n } else {\n context.drawImage(cacheCanvas, x, y, width, height);\n }\n } else if (activeChartInstance) {\n if (typeof dataId === 'string') {\n activeChartInstance.updateDataSync(dataId, data ?? []);\n } else {\n const dataBatch = [];\n // 如果是组合图有series系列 需要组个设置数据 这里的data包括的单元格完整数据 需要根据key过滤\n for (const dataIdStr in dataId) {\n const dataIdAndField = dataId[dataIdStr];\n const series = spec.series.find((item: any) => item?.data?.id === dataIdStr);\n dataBatch.push({\n id: dataIdStr,\n values: dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? [],\n fields: series?.data?.fields\n });\n if (!activeChartInstance.updateFullDataSync) {\n activeChartInstance.updateDataSync(\n dataIdStr,\n dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? []\n );\n }\n }\n activeChartInstance.updateFullDataSync?.(dataBatch);\n }\n } else {\n if ((chart.getRootNode() as any).table.internalProps.renderChartAsync) {\n if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {\n chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);\n chartRenderQueueList.push(chart);\n }\n //判断是否已经开启渲染队列\n if (!IsHandlingChartQueue()) {\n startRenderChartQueue((chart.getRootNode() as any).table);\n }\n } else {\n renderChart(chart);\n }\n }\n }\n\n draw(chart: Chart, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const { context } = drawContext;\n if (!context) {\n return;\n }\n // debugger;\n const { clip } = chart.attribute;\n if (clip) {\n context.save();\n } else {\n context.highPerformanceSave();\n }\n // group直接transform\n context.transformFromMatrix(chart.transMatrix, true);\n\n context.beginPath();\n // 如果跳过绘制,那就不绘制\n if (params.skipDraw) {\n this.drawShape(\n chart,\n context,\n 0,\n 0,\n drawContext,\n params,\n () => false,\n () => false\n );\n } else {\n this.drawShape(chart, context, 0, 0, drawContext);\n }\n\n if (clip) {\n context.restore();\n } else {\n context.highPerformanceRestore();\n }\n }\n}\n"]}
@@ -64,8 +64,7 @@ export function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, c
64
64
  data: table.getCellValue(col, row),
65
65
  cellPadding: padding,
66
66
  dpr: table.internalProps.pixelRatio,
67
- axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
68
- tableChartOption: table.options.chartOption
67
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
69
68
  });
70
69
  return cellGroup.appendChild(chartGroup), table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance),
71
70
  cellGroup;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/group-creater/cell-type/chart-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,MAAM,UAAU,oBAAoB,CAClC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,K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E,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;QAOtF,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;KAC5C,CAAC,CAAC;IACH,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAElC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAEnF,OAAO,SAAS,CAAC;AACnB,CAAC","file":"chart-cell.js","sourcesContent":["import { Group } from '../../graphic/group';\nimport { Chart } from '../../graphic/chart';\nimport * as registerChartTypes from '../../../chartModule';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { IThemeSpec } from './../../../vrender';\nimport { getCellBorderStrokeWidth } from '../../utils/cell-border-stroke-width';\nexport function createChartCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n dataValue: string,\n chartModule: any,\n chartSpec: any,\n chartInstance: any,\n dataId: string | Record<string, string>,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n isShareChartSpec: true,\n isAsync: boolean\n) {\n // 获取注册的chart图表类型\n const registerCharts = registerChartTypes.get();\n const ClassType = registerCharts[chartModule];\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n // cell\n if (!cellGroup) {\n const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);\n\n if (isAsync) {\n cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n if (cellGroup && cellGroup.role === 'cell') {\n cellGroup.setAttributes({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: strokeArrayWidth,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n lineDash: cellTheme?.group?.lineDash ?? undefined,\n lineCap: 'butt',\n clip: true,\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n }\n }\n if (!cellGroup || cellGroup.role !== 'cell') {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: strokeArrayWidth,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n lineDash: cellTheme?.group?.lineDash ?? undefined,\n lineCap: 'butt',\n clip: true,\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addCellGroup(cellGroup);\n }\n }\n cellGroup.AABBBounds.width(); // TODO 需要底层VRender修改\n // chart\n const chartGroup = new Chart(isShareChartSpec, {\n stroke: false,\n x: padding[3],\n y: padding[0],\n // canvas: table.canvas,\n canvas: table.canvas ?? (table.scenegraph.stage.window.getContext().canvas as unknown as HTMLCanvasElement),\n mode: table.options.mode,\n modeParams: table.options.modeParams,\n spec: chartSpec,\n ClassType,\n width: width - padding[3] - padding[1],\n height: height - padding[2] - padding[0],\n chartInstance,\n dataId,\n data: table.getCellValue(col, row),\n cellPadding: padding,\n dpr: table.internalProps.pixelRatio,\n // viewBox: {\n // x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),\n // x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width - padding[1] + table.scrollLeft),\n // y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),\n // y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height - padding[2] + table.scrollTop)\n // },\n axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],\n // clipRect: {\n // left: cellGroup.globalAABBBounds.x1 + (table as any).tableX + padding[3],\n // top: cellGroup.globalAABBBounds.y1 + (table as any).tableY + padding[0],\n // width: width - padding[1] - padding[3], //cellGroup.globalAABBBounds.width() - padding[1] - padding[3],\n // height: height - padding[0] - padding[2],\n // },\n tableChartOption: table.options.chartOption\n });\n cellGroup.appendChild(chartGroup);\n // 将生成的实例存到layoutMap中 共享\n table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);\n\n return cellGroup;\n}\n\nexport type CreateChartCellGroup = typeof createChartCellGroup;\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/group-creater/cell-type/chart-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,MAAM,UAAU,oBAAoB,CAClC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAAiB,EACjB,WAAgB,EAChB,SAAc,EACd,aAAkB,EAClB,MAAuC,EACvC,KAAmB,EACnB,SAAqB,EACrB,gBAAsB,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AC;IACH,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAElC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAEnF,OAAO,SAAS,CAAC;AACnB,CAAC","file":"chart-cell.js","sourcesContent":["import { Group } from '../../graphic/group';\nimport { Chart } from '../../graphic/chart';\nimport * as registerChartTypes from '../../../chartModule';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { IThemeSpec } from './../../../vrender';\nimport { getCellBorderStrokeWidth } from '../../utils/cell-border-stroke-width';\nexport function createChartCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n dataValue: string,\n chartModule: any,\n chartSpec: any,\n chartInstance: any,\n dataId: string | Record<string, string>,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n isShareChartSpec: true,\n isAsync: boolean\n) {\n // 获取注册的chart图表类型\n const registerCharts = registerChartTypes.get();\n const ClassType = registerCharts[chartModule];\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n // cell\n if (!cellGroup) {\n const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);\n\n if (isAsync) {\n cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n if (cellGroup && cellGroup.role === 'cell') {\n cellGroup.setAttributes({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: strokeArrayWidth,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n lineDash: cellTheme?.group?.lineDash ?? undefined,\n lineCap: 'butt',\n clip: true,\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n }\n }\n if (!cellGroup || cellGroup.role !== 'cell') {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: strokeArrayWidth,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n lineDash: cellTheme?.group?.lineDash ?? undefined,\n lineCap: 'butt',\n clip: true,\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addCellGroup(cellGroup);\n }\n }\n cellGroup.AABBBounds.width(); // TODO 需要底层VRender修改\n // chart\n const chartGroup = new Chart(isShareChartSpec, {\n stroke: false,\n x: padding[3],\n y: padding[0],\n // canvas: table.canvas,\n canvas: table.canvas ?? (table.scenegraph.stage.window.getContext().canvas as unknown as HTMLCanvasElement),\n mode: table.options.mode,\n modeParams: table.options.modeParams,\n spec: chartSpec,\n ClassType,\n width: width - padding[3] - padding[1],\n height: height - padding[2] - padding[0],\n chartInstance,\n dataId,\n data: table.getCellValue(col, row),\n cellPadding: padding,\n dpr: table.internalProps.pixelRatio,\n // viewBox: {\n // x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),\n // x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width - padding[1] + table.scrollLeft),\n // y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),\n // y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height - padding[2] + table.scrollTop)\n // },\n axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []\n // clipRect: {\n // left: cellGroup.globalAABBBounds.x1 + (table as any).tableX + padding[3],\n // top: cellGroup.globalAABBBounds.y1 + (table as any).tableY + padding[0],\n // width: width - padding[1] - padding[3], //cellGroup.globalAABBBounds.width() - padding[1] - padding[3],\n // height: height - padding[0] - padding[2],\n // },\n });\n cellGroup.appendChild(chartGroup);\n // 将生成的实例存到layoutMap中 共享\n table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);\n\n return cellGroup;\n}\n\nexport type CreateChartCellGroup = typeof createChartCellGroup;\n"]}
@@ -70,7 +70,7 @@ export function updateCellHeight(scene, cell, col, row, distHeight, detaY, isHea
70
70
  const customMergeRange = getCustomCellMergeCustom(col, row, cell, scene.table);
71
71
  if (customMergeRange) for (let mergeRow = customMergeRange.start.row; mergeRow <= customMergeRange.end.row; mergeRow++) {
72
72
  if (mergeRow === row) continue;
73
- const mergedCell = scene.getCell(col, mergeRow), customContainer = cell.getChildByName(CUSTOM_CONTAINER_NAME) || cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
73
+ const mergedCell = scene.getCell(col, mergeRow), customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) || mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
74
74
  customContainer.removeAllChild(), mergedCell.removeChild(customContainer), getCustomCellMergeCustom(col, mergeRow, mergedCell, scene.table);
75
75
  } else {
76
76
  let customRender, customLayout;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/update-height.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC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ACD,GAAG,EAAE;wBACH,GAAG,EAAE,SAAS,CAAC,WAAW;wBAC1B,GAAG,EAAE,SAAS,CAAC,WAAW;qBAC3B;iBACF,EACD,KAAK,CACN,CAAC;gBAEF,IAAI,WAAW,EAAE;oBACf,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC;iBACxC;aACF;SACF;KACF;SAAM;QACL,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QAChE,uBAAuB,CACrB,SAAS,EACT,UAAU,EACV,KAAK,EACL,aAAa,EACb,YAAY,CAAC,KAAK,CAAC,OAAiB,CAAC,EACrC,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,YAAY,CACnB,CAAC;KACH;AACH,CAAC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport type { CreateProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport type { 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 { CUSTOM_CONTAINER_NAME, CUSTOM_MERGE_CONTAINER_NAME, dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport { resizeCellGroup, getCustomCellMergeCustom } from '../group-creater/cell-helper';\nimport type { IGraphic } from './../../vrender';\nimport { getCellMergeRange } from '../../tools/merge-range';\nimport type { ColumnDefine } from '../../ts-types';\nimport { Factory } from '../../core/factory';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number, skipTableHeightMap?: boolean) {\n // 更新table行高存储\n if (!skipTableHeightMap) {\n scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n }\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n if (cell.role === 'empty') {\n continue;\n }\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, 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.frozenRowCount) {\n // scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n // scene.rowHeaderGroup.setAttribute('y', scene.rowHeaderGroup.attribute.y + detaY);\n // scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.frozenRowCount - 1;\n } else if (row >= scene.table.rowCount - scene.table.bottomFrozenRowCount) {\n rowStart = row + 1;\n rowEnd = scene.table.rowCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = Math.min(scene.proxy.rowEnd, scene.table.rowCount - scene.table.bottomFrozenRowCount - 1); //- scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n const cellGroup = scene.highPerformanceGetCell(colIndex, rowIndex);\n if (cellGroup.role === 'cell') {\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n }\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 // cell.setAttribute('height', height);\n const cellGroup = cell;\n const distHeight = height;\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 // cell.setAttribute('height', height);\n const cellGroup = cell;\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 if (cell.attribute.height === distHeight && !cell.needUpdateHeight) {\n return;\n }\n cell.needUpdateHeight = false;\n\n cell.setAttribute('height', distHeight);\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? (scene.table._getHeaderLayoutMap(col, row) as HeaderData).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 createProgressBarCell = Factory.getFunction('createProgressBarCell') as CreateProgressBarCell;\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 const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup') as CreateSparkLineCellGroup;\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 false\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, 0, detaY, 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 let renderDefault = true;\n const customContainer =\n (cell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n if (customContainer) {\n if (scene.table.reactCustomLayout) {\n scene.table.reactCustomLayout.removeCustomCell(col, row);\n }\n\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n const customMergeRange = getCustomCellMergeCustom(col, row, cell, scene.table);\n if (customMergeRange) {\n for (let mergeRow = customMergeRange.start.row; mergeRow <= customMergeRange.end.row; mergeRow++) {\n if (mergeRow === row) {\n continue;\n }\n const mergedCell = scene.getCell(col, mergeRow);\n const customContainer =\n (cell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n customContainer.removeAllChild();\n mergedCell.removeChild(customContainer);\n getCustomCellMergeCustom(col, mergeRow, mergedCell, scene.table);\n }\n } else {\n let customRender;\n let customLayout;\n const cellLocation = scene.table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = (define as ColumnDefine)?.headerCustomRender;\n customLayout = (define as ColumnDefine)?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = (define as ColumnDefine)?.customRender || scene.table.customRender;\n customLayout = (define as ColumnDefine)?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n let width = cell.attribute.width;\n let height = cell.attribute.height;\n if (isMergeCellGroup(cell)) {\n width = scene.table.getColsWidth(cell.mergeStartCol, cell.mergeEndCol);\n height = scene.table.getRowsHeight(cell.mergeStartRow, cell.mergeEndRow);\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n width,\n height,\n false,\n // scene.table.heightMode === 'autoHeight',\n scene.table.isAutoRowHeight(row),\n padding,\n isMergeCellGroup(cell)\n ? {\n start: { col: cell.mergeStartCol, row: cell.mergeStartRow },\n end: { col: cell.mergeEndCol, row: cell.mergeEndRow }\n }\n : undefined,\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n\n if (cell.childrenCount > 0 && customElementsGroup) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else if (customElementsGroup) {\n cell.appendChild(customElementsGroup);\n }\n }\n }\n // if (renderDefault) {\n // // 处理文字\n // const style = scene.table._getCellStyle(col, row);\n // updateMergeCellContentHeight(\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 // scene.table\n // );\n // }\n updateMergeCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.heightMode === 'autoHeight',\n scene.table.isAutoRowHeight(row),\n renderDefault,\n scene.table\n );\n }\n}\n\nfunction updateMergeCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n renderDefault: boolean,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n distHeight += table.getRowHeight(row);\n }\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n\n if (renderDefault) {\n const style = table._getCellStyle(col, row);\n updateCellContentHeight(\n singleCellGroup,\n distHeight,\n detaY,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n }\n\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { height: contentHeight } = cellGroup.attribute;\n singleCellGroup.contentHeight = distHeight;\n\n const { widthChange } = resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n\n if (widthChange) {\n singleCellGroup.needUpdateWidth = true;\n }\n }\n }\n } else {\n const style = table._getCellStyle(cellGroup.col, cellGroup.row);\n updateCellContentHeight(\n cellGroup,\n distHeight,\n detaY,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/layout/update-height.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,M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,aAAa;qBAC7B;oBACD,GAAG,EAAE;wBACH,GAAG,EAAE,SAAS,CAAC,WAAW;wBAC1B,GAAG,EAAE,SAAS,CAAC,WAAW;qBAC3B;iBACF,EACD,KAAK,CACN,CAAC;gBAEF,IAAI,WAAW,EAAE;oBACf,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC;iBACxC;aACF;SACF;KACF;SAAM;QACL,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QAChE,uBAAuB,CACrB,SAAS,EACT,UAAU,EACV,KAAK,EACL,aAAa,EACb,YAAY,CAAC,KAAK,CAAC,OAAiB,CAAC,EACrC,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,YAAY,CACnB,CAAC;KACH;AACH,CAAC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport type { CreateProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport type { 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 { CUSTOM_CONTAINER_NAME, CUSTOM_MERGE_CONTAINER_NAME, dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport { resizeCellGroup, getCustomCellMergeCustom } from '../group-creater/cell-helper';\nimport type { IGraphic } from './../../vrender';\nimport { getCellMergeRange } from '../../tools/merge-range';\nimport type { ColumnDefine } from '../../ts-types';\nimport { Factory } from '../../core/factory';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number, skipTableHeightMap?: boolean) {\n // 更新table行高存储\n if (!skipTableHeightMap) {\n scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n }\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n if (cell.role === 'empty') {\n continue;\n }\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, 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.frozenRowCount) {\n // scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n // scene.rowHeaderGroup.setAttribute('y', scene.rowHeaderGroup.attribute.y + detaY);\n // scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.frozenRowCount - 1;\n } else if (row >= scene.table.rowCount - scene.table.bottomFrozenRowCount) {\n rowStart = row + 1;\n rowEnd = scene.table.rowCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = Math.min(scene.proxy.rowEnd, scene.table.rowCount - scene.table.bottomFrozenRowCount - 1); //- scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n const cellGroup = scene.highPerformanceGetCell(colIndex, rowIndex);\n if (cellGroup.role === 'cell') {\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n }\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 // cell.setAttribute('height', height);\n const cellGroup = cell;\n const distHeight = height;\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 // cell.setAttribute('height', height);\n const cellGroup = cell;\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 if (cell.attribute.height === distHeight && !cell.needUpdateHeight) {\n return;\n }\n cell.needUpdateHeight = false;\n\n cell.setAttribute('height', distHeight);\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? (scene.table._getHeaderLayoutMap(col, row) as HeaderData).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 createProgressBarCell = Factory.getFunction('createProgressBarCell') as CreateProgressBarCell;\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 const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup') as CreateSparkLineCellGroup;\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 false\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, 0, detaY, 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 let renderDefault = true;\n const customContainer =\n (cell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n if (customContainer) {\n if (scene.table.reactCustomLayout) {\n scene.table.reactCustomLayout.removeCustomCell(col, row);\n }\n\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n const customMergeRange = getCustomCellMergeCustom(col, row, cell, scene.table);\n if (customMergeRange) {\n for (let mergeRow = customMergeRange.start.row; mergeRow <= customMergeRange.end.row; mergeRow++) {\n if (mergeRow === row) {\n continue;\n }\n const mergedCell = scene.getCell(col, mergeRow);\n const customContainer =\n (mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n customContainer.removeAllChild();\n mergedCell.removeChild(customContainer);\n getCustomCellMergeCustom(col, mergeRow, mergedCell, scene.table);\n }\n } else {\n let customRender;\n let customLayout;\n const cellLocation = scene.table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = (define as ColumnDefine)?.headerCustomRender;\n customLayout = (define as ColumnDefine)?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = (define as ColumnDefine)?.customRender || scene.table.customRender;\n customLayout = (define as ColumnDefine)?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n let width = cell.attribute.width;\n let height = cell.attribute.height;\n if (isMergeCellGroup(cell)) {\n width = scene.table.getColsWidth(cell.mergeStartCol, cell.mergeEndCol);\n height = scene.table.getRowsHeight(cell.mergeStartRow, cell.mergeEndRow);\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n width,\n height,\n false,\n // scene.table.heightMode === 'autoHeight',\n scene.table.isAutoRowHeight(row),\n padding,\n isMergeCellGroup(cell)\n ? {\n start: { col: cell.mergeStartCol, row: cell.mergeStartRow },\n end: { col: cell.mergeEndCol, row: cell.mergeEndRow }\n }\n : undefined,\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n\n if (cell.childrenCount > 0 && customElementsGroup) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else if (customElementsGroup) {\n cell.appendChild(customElementsGroup);\n }\n }\n }\n // if (renderDefault) {\n // // 处理文字\n // const style = scene.table._getCellStyle(col, row);\n // updateMergeCellContentHeight(\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 // scene.table\n // );\n // }\n updateMergeCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.heightMode === 'autoHeight',\n scene.table.isAutoRowHeight(row),\n renderDefault,\n scene.table\n );\n }\n}\n\nfunction updateMergeCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n renderDefault: boolean,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n distHeight += table.getRowHeight(row);\n }\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n\n if (renderDefault) {\n const style = table._getCellStyle(col, row);\n updateCellContentHeight(\n singleCellGroup,\n distHeight,\n detaY,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n }\n\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { height: contentHeight } = cellGroup.attribute;\n singleCellGroup.contentHeight = distHeight;\n\n const { widthChange } = resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n\n if (widthChange) {\n singleCellGroup.needUpdateWidth = true;\n }\n }\n }\n } else {\n const style = table._getCellStyle(cellGroup.col, cellGroup.row);\n updateCellContentHeight(\n cellGroup,\n distHeight,\n detaY,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n }\n}\n"]}
@@ -140,7 +140,7 @@ function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHe
140
140
  const customMergeRange = getCustomCellMergeCustom(col, row, cell, scene.table);
141
141
  if (customMergeRange) for (let mergeCol = customMergeRange.start.col; mergeCol <= customMergeRange.end.col; mergeCol++) {
142
142
  if (mergeCol === col) continue;
143
- const mergedCell = scene.getCell(mergeCol, row), customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) || cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
143
+ const mergedCell = scene.getCell(mergeCol, row), customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) || mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
144
144
  customContainer.removeAllChild(), mergedCell.removeChild(customContainer), getCustomCellMergeCustom(mergeCol, row, mergedCell, scene.table);
145
145
  } else {
146
146
  let customRender, customLayout;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/update-width.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzG,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAG1F,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAW5D,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE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,CAAC;IAE9F,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAGhD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,UAAU,GAAG,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO;SACR;QAED,sBAAsB,CACpB,KAAK,EACL,IAAI,EACJ,GAAG,EACH,GAAG,EACH,UAAU,EACV,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAClC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAC/B,CAAC;KACH;AACH,CAAC","file":"update-width.js","sourcesContent":["import type { IGraphic } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { CUSTOM_CONTAINER_NAME, CUSTOM_MERGE_CONTAINER_NAME, dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport type { CreateProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport type { CreateSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport { resizeCellGroup, getCustomCellMergeCustom } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { computeRowHeight } from './compute-row-height';\nimport { updateCellHeightForRow } from './update-height';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getCellMergeRange } from '../../tools/merge-range';\nimport type { ColumnDefine } from '../../ts-types';\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, skipTableWidthMap?: boolean) {\n if (!skipTableWidthMap) {\n scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);\n }\n\n // deal with corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const rightTopColumn = scene.getColGroupInRightTopCorner(col);\n if (colOrCornerHeaderColumn && !rightTopColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, 'col-corner', scene);\n }\n // deal with right bottom frozen cells\n if (rightTopColumn) {\n updateColunmWidth(rightTopColumn, detaX, 'right-top', scene);\n }\n\n // deal with row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal with left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, 'left-bottom', scene);\n }\n // deal with bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, 'bottom', scene);\n }\n // deal with right bottom frozen cells\n const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);\n if (rightBottomColumn) {\n updateColunmWidth(rightBottomColumn, detaX, 'right-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 if (rightBottomColumn) {\n scene.rightBottomCornerGroup.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' | 'right-top' | 'right-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 oldColumnWidth + detaX,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n scene.table.internalProps.autoWrapText\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 } else if (mode === 'right-top') {\n row = 0;\n colGroup = scene.getColGroupInRightTopCorner(col);\n oldContainerHeight = scene.rightTopCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInRightBottomCorner(col);\n oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;\n }\n if (!colGroup) {\n continue;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n //#region 修改bug:https://github.com/VisActor/VTable/issues/954 添加底部冻结行的三块区域\n for (let col = 0; col < scene.table.frozenColCount; col++) {\n const leftBottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n // reset cell y\n let y = 0;\n leftBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n for (let col = scene.table.colCount - scene.table.rightFrozenColCount; col < scene.table.colCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n\n for (let col = scene.table.frozenColCount; col < scene.table.colCount - scene.table.rightFrozenColCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n //#endregion\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n oldWidth: number, // old width, not dist\n distWidth: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoWrapText: boolean\n): boolean {\n if (cell.attribute.width === distWidth && !cell.needUpdateWidth) {\n return false;\n }\n cell.needUpdateWidth = false;\n\n cell.setAttribute('width', distWidth);\n // const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // if (mergeInfo && mergeInfo.start.row !== row) {\n // return false;\n // }\n const cellGroup = cell;\n // const distWidth = width + detaX;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n const autoRowHeight = scene.table.isAutoRowHeight(row);\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? (scene.table._getHeaderLayoutMap(col, row) as HeaderData).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 createProgressBarCell = Factory.getFunction('createProgressBarCell') as CreateProgressBarCell;\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 const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup') as CreateSparkLineCellGroup;\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 false\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, detaX, 0, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n const cellStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));\n if (axisConfig) {\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(\n axisConfig,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\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 let renderDefault = true;\n const customContainer =\n (cell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n if (customContainer) {\n if (scene.table.reactCustomLayout) {\n scene.table.reactCustomLayout.removeCustomCell(col, row);\n }\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n const customMergeRange = getCustomCellMergeCustom(col, row, cell, scene.table);\n if (customMergeRange) {\n for (let mergeCol = customMergeRange.start.col; mergeCol <= customMergeRange.end.col; mergeCol++) {\n if (mergeCol === col) {\n continue;\n }\n const mergedCell = scene.getCell(mergeCol, row);\n const customContainer =\n (mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n customContainer.removeAllChild();\n mergedCell.removeChild(customContainer);\n getCustomCellMergeCustom(mergeCol, row, mergedCell, scene.table);\n }\n } else {\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellLocation(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = (define as ColumnDefine)?.headerCustomRender;\n customLayout = (define as ColumnDefine)?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = (define as ColumnDefine)?.customRender || scene.table.customRender;\n customLayout = (define as ColumnDefine)?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n let width = cellGroup.attribute.width;\n let height = cellGroup.attribute.height;\n if (isMergeCellGroup(cellGroup)) {\n width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);\n height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n width,\n height,\n false,\n // scene.table.heightMode === 'autoHeight',\n scene.table.isAutoRowHeight(row),\n padding,\n isMergeCellGroup(cellGroup)\n ? {\n start: { col: cellGroup.mergeStartCol, row: cellGroup.mergeStartRow },\n end: { col: cellGroup.mergeEndCol, row: cellGroup.mergeEndRow }\n }\n : undefined,\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n isHeightChange = true;\n }\n\n if (cell.childrenCount > 0 && customElementsGroup) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else if (customElementsGroup) {\n cell.appendChild(customElementsGroup);\n }\n }\n }\n const cellChange = updateMergeCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n renderDefault,\n scene.table\n );\n isHeightChange = isHeightChange || cellChange;\n }\n if (!autoWrapText) {\n const style = scene.table._getCellStyle(col, row);\n autoWrapText = style.autoWrapText;\n }\n return autoRowHeight && autoWrapText ? isHeightChange : false;\n}\n\nfunction updateMergeCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n detaX: number,\n autoRowHeight: boolean,\n renderDefault: boolean,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distWidth = 0;\n let isHeightChange = false;\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n distWidth += table.getColWidth(col);\n }\n let cellHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n cellHeight += table.getRowHeight(row);\n }\n\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n if (col === cellGroup.col && row !== cellGroup.row) {\n continue;\n }\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n\n let changed = false;\n if (renderDefault) {\n // 处理文字\n const style = table._getCellStyle(col, row);\n const padding = getQuadProps(style.padding as number);\n const textAlign = style.textAlign;\n const textBaseline = style.textBaseline;\n changed = updateCellContentWidth(\n singleCellGroup,\n distWidth,\n cellHeight,\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n\n // reset hierarchy offset\n const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);\n if (hierarchyOffset) {\n const text = singleCellGroup.getChildByName('text');\n const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');\n // icon-left deal with hierarchy offset, no need add to text dx\n if (icon?.role !== 'icon-left' && text) {\n text.setAttribute('dx', hierarchyOffset);\n }\n }\n }\n\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { width: contentWidth } = cellGroup.attribute;\n singleCellGroup.contentWidth = distWidth;\n\n const { heightChange } = resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n\n if (heightChange) {\n singleCellGroup.needUpdateHeight = true;\n }\n\n isHeightChange = isHeightChange || changed;\n }\n }\n return isHeightChange;\n }\n\n // 处理文字\n const style = table._getCellStyle(cellGroup.col, cellGroup.row);\n const padding = getQuadProps(style.padding as number);\n const textAlign = style.textAlign;\n const textBaseline = style.textBaseline;\n return updateCellContentWidth(\n cellGroup,\n distWidth,\n table.getRowHeight(cellGroup.row),\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n // 获取高度\n const maxHeight = Math.round(computeRowHeight(row, 0, scene.table.colCount - 1, scene.table));\n // 更新table行高存储\n scene.table._setRowHeight(row, maxHeight, true);\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n\n updateCellHeightForRow(\n scene,\n cell,\n col,\n row,\n distHeight,\n distHeight - cell.attribute.height,\n scene.table.isHeader(col, row)\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/layout/update-width.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzG,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAG1F,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OA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EACZ,KAAK,CAAC,UAAU,CACjB,CAAC;AACJ,CAAC;AAQD,SAAS,cAAc,CAAC,KAAiB,EAAE,GAAW;IAEpD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9F,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAGhD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,UAAU,GAAG,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO;SACR;QAED,sBAAsB,CACpB,KAAK,EACL,IAAI,EACJ,GAAG,EACH,GAAG,EACH,UAAU,EACV,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAClC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAC/B,CAAC;KACH;AACH,CAAC","file":"update-width.js","sourcesContent":["import type { IGraphic } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { CUSTOM_CONTAINER_NAME, CUSTOM_MERGE_CONTAINER_NAME, dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport type { CreateProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport type { CreateSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport { resizeCellGroup, getCustomCellMergeCustom } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { computeRowHeight } from './compute-row-height';\nimport { updateCellHeightForRow } from './update-height';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getCellMergeRange } from '../../tools/merge-range';\nimport type { ColumnDefine } from '../../ts-types';\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, skipTableWidthMap?: boolean) {\n if (!skipTableWidthMap) {\n scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);\n }\n\n // deal with corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const rightTopColumn = scene.getColGroupInRightTopCorner(col);\n if (colOrCornerHeaderColumn && !rightTopColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, 'col-corner', scene);\n }\n // deal with right bottom frozen cells\n if (rightTopColumn) {\n updateColunmWidth(rightTopColumn, detaX, 'right-top', scene);\n }\n\n // deal with row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal with left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, 'left-bottom', scene);\n }\n // deal with bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, 'bottom', scene);\n }\n // deal with right bottom frozen cells\n const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);\n if (rightBottomColumn) {\n updateColunmWidth(rightBottomColumn, detaX, 'right-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 if (rightBottomColumn) {\n scene.rightBottomCornerGroup.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' | 'right-top' | 'right-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 oldColumnWidth + detaX,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n scene.table.internalProps.autoWrapText\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 } else if (mode === 'right-top') {\n row = 0;\n colGroup = scene.getColGroupInRightTopCorner(col);\n oldContainerHeight = scene.rightTopCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInRightBottomCorner(col);\n oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;\n }\n if (!colGroup) {\n continue;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n //#region 修改bug:https://github.com/VisActor/VTable/issues/954 添加底部冻结行的三块区域\n for (let col = 0; col < scene.table.frozenColCount; col++) {\n const leftBottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n // reset cell y\n let y = 0;\n leftBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n for (let col = scene.table.colCount - scene.table.rightFrozenColCount; col < scene.table.colCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n\n for (let col = scene.table.frozenColCount; col < scene.table.colCount - scene.table.rightFrozenColCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n //#endregion\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n oldWidth: number, // old width, not dist\n distWidth: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoWrapText: boolean\n): boolean {\n if (cell.attribute.width === distWidth && !cell.needUpdateWidth) {\n return false;\n }\n cell.needUpdateWidth = false;\n\n cell.setAttribute('width', distWidth);\n // const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // if (mergeInfo && mergeInfo.start.row !== row) {\n // return false;\n // }\n const cellGroup = cell;\n // const distWidth = width + detaX;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n const autoRowHeight = scene.table.isAutoRowHeight(row);\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? (scene.table._getHeaderLayoutMap(col, row) as HeaderData).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 createProgressBarCell = Factory.getFunction('createProgressBarCell') as CreateProgressBarCell;\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 const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup') as CreateSparkLineCellGroup;\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 false\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, detaX, 0, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n const cellStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));\n if (axisConfig) {\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(\n axisConfig,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\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 let renderDefault = true;\n const customContainer =\n (cell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n if (customContainer) {\n if (scene.table.reactCustomLayout) {\n scene.table.reactCustomLayout.removeCustomCell(col, row);\n }\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n const customMergeRange = getCustomCellMergeCustom(col, row, cell, scene.table);\n if (customMergeRange) {\n for (let mergeCol = customMergeRange.start.col; mergeCol <= customMergeRange.end.col; mergeCol++) {\n if (mergeCol === col) {\n continue;\n }\n const mergedCell = scene.getCell(mergeCol, row);\n const customContainer =\n (mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) as Group) ||\n (mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME) as Group);\n customContainer.removeAllChild();\n mergedCell.removeChild(customContainer);\n getCustomCellMergeCustom(mergeCol, row, mergedCell, scene.table);\n }\n } else {\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellLocation(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = (define as ColumnDefine)?.headerCustomRender;\n customLayout = (define as ColumnDefine)?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = (define as ColumnDefine)?.customRender || scene.table.customRender;\n customLayout = (define as ColumnDefine)?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n let width = cellGroup.attribute.width;\n let height = cellGroup.attribute.height;\n if (isMergeCellGroup(cellGroup)) {\n width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);\n height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n width,\n height,\n false,\n // scene.table.heightMode === 'autoHeight',\n scene.table.isAutoRowHeight(row),\n padding,\n isMergeCellGroup(cellGroup)\n ? {\n start: { col: cellGroup.mergeStartCol, row: cellGroup.mergeStartRow },\n end: { col: cellGroup.mergeEndCol, row: cellGroup.mergeEndRow }\n }\n : undefined,\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n isHeightChange = true;\n }\n\n if (cell.childrenCount > 0 && customElementsGroup) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else if (customElementsGroup) {\n cell.appendChild(customElementsGroup);\n }\n }\n }\n const cellChange = updateMergeCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n renderDefault,\n scene.table\n );\n isHeightChange = isHeightChange || cellChange;\n }\n if (!autoWrapText) {\n const style = scene.table._getCellStyle(col, row);\n autoWrapText = style.autoWrapText;\n }\n return autoRowHeight && autoWrapText ? isHeightChange : false;\n}\n\nfunction updateMergeCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n detaX: number,\n autoRowHeight: boolean,\n renderDefault: boolean,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distWidth = 0;\n let isHeightChange = false;\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n distWidth += table.getColWidth(col);\n }\n let cellHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n cellHeight += table.getRowHeight(row);\n }\n\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n if (col === cellGroup.col && row !== cellGroup.row) {\n continue;\n }\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n\n let changed = false;\n if (renderDefault) {\n // 处理文字\n const style = table._getCellStyle(col, row);\n const padding = getQuadProps(style.padding as number);\n const textAlign = style.textAlign;\n const textBaseline = style.textBaseline;\n changed = updateCellContentWidth(\n singleCellGroup,\n distWidth,\n cellHeight,\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n\n // reset hierarchy offset\n const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);\n if (hierarchyOffset) {\n const text = singleCellGroup.getChildByName('text');\n const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');\n // icon-left deal with hierarchy offset, no need add to text dx\n if (icon?.role !== 'icon-left' && text) {\n text.setAttribute('dx', hierarchyOffset);\n }\n }\n }\n\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { width: contentWidth } = cellGroup.attribute;\n singleCellGroup.contentWidth = distWidth;\n\n const { heightChange } = resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n\n if (heightChange) {\n singleCellGroup.needUpdateHeight = true;\n }\n\n isHeightChange = isHeightChange || changed;\n }\n }\n return isHeightChange;\n }\n\n // 处理文字\n const style = table._getCellStyle(cellGroup.col, cellGroup.row);\n const padding = getQuadProps(style.padding as number);\n const textAlign = style.textAlign;\n const textBaseline = style.textBaseline;\n return updateCellContentWidth(\n cellGroup,\n distWidth,\n table.getRowHeight(cellGroup.row),\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n // 获取高度\n const maxHeight = Math.round(computeRowHeight(row, 0, scene.table.colCount - 1, scene.table));\n // 更新table行高存储\n scene.table._setRowHeight(row, maxHeight, true);\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n\n updateCellHeightForRow(\n scene,\n cell,\n col,\n row,\n distHeight,\n distHeight - cell.attribute.height,\n scene.table.isHeader(col, row)\n );\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { Scenegraph } from '../scenegraph';
2
- export declare function updateChartSize(scenegraph: Scenegraph, col: number): void;
2
+ export declare function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number): void;
3
+ export declare function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number): void;
3
4
  export declare function clearChartCacheImage(scenegraph: Scenegraph): void;
4
- export declare function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph): void;
5
5
  export declare function updateChartData(scenegraph: Scenegraph): void;
6
6
  export declare function updateChartState(scenegraph: Scenegraph, datum: any): void;
@@ -6,7 +6,7 @@ import { getQuadProps } from "../utils/padding";
6
6
 
7
7
  import { getProp } from "../utils/get-prop";
8
8
 
9
- export function updateChartSize(scenegraph, col) {
9
+ export function updateChartSizeForResizeColWidth(scenegraph, col) {
10
10
  var _a, _b;
11
11
  for (let c = col; c <= scenegraph.proxy.colEnd; c++) {
12
12
  const columnGroup = scenegraph.getColGroup(c);
@@ -30,6 +30,19 @@ export function updateChartSize(scenegraph, col) {
30
30
  }
31
31
  }
32
32
 
33
+ export function updateChartSizeForResizeRowHeight(scenegraph, row) {
34
+ const updateCellNode = (c, r) => {
35
+ const cellNode = scenegraph.getCell(c, r), width = scenegraph.table.getColWidth(cellNode.col), height = scenegraph.table.getRowHeight(cellNode.row);
36
+ cellNode.children.forEach((node => {
37
+ "chart" === node.type && (node.cacheCanvas = null, node.setAttribute("width", Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])),
38
+ node.setAttribute("height", Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])));
39
+ }));
40
+ };
41
+ for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) for (let r = row; r <= scenegraph.proxy.rowEnd; r++) updateCellNode(c, r);
42
+ if (scenegraph.table.rightFrozenColCount >= 1) for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) for (let r = row; r <= scenegraph.proxy.rowEnd; r++) updateCellNode(c, r);
43
+ if (scenegraph.table.frozenColCount >= 1) for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) for (let r = row; r <= scenegraph.proxy.rowEnd; r++) updateCellNode(c, r);
44
+ }
45
+
33
46
  export function clearChartCacheImage(scenegraph) {
34
47
  var _a;
35
48
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -42,12 +55,6 @@ export function clearChartCacheImage(scenegraph) {
42
55
  }
43
56
  }
44
57
 
45
- export function clearCellChartCacheImage(col, row, scenegraph) {
46
- scenegraph.getCell(col, row).children.forEach((node => {
47
- "chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
48
- }));
49
- }
50
-
51
58
  export function updateChartData(scenegraph) {
52
59
  var _a;
53
60
  const table = scenegraph.table;
@@ -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,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,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,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,CAA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I,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,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 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 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\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 = {};\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,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AAC,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"]}