@visactor/vtable 1.22.11-alpha.6 → 1.22.11-alpha.7

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 (133) hide show
  1. package/cjs/ListTable.d.ts +34 -7
  2. package/cjs/ListTable.js +134 -14
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +0 -3
  5. package/cjs/PivotChart.js +5 -12
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/body-helper/style.js +1 -2
  8. package/cjs/core/BaseTable.js +1 -1
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/core/FouseInput.js +2 -1
  11. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  12. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  13. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  14. package/cjs/core/index.d.ts +1 -0
  15. package/cjs/core/index.js +30 -0
  16. package/cjs/core/index.js.map +1 -0
  17. package/cjs/core/record-helper.d.ts +4 -2
  18. package/cjs/core/record-helper.js +120 -47
  19. package/cjs/core/record-helper.js.map +1 -1
  20. package/cjs/data/DataSource.d.ts +10 -4
  21. package/cjs/data/DataSource.js +155 -56
  22. package/cjs/data/DataSource.js.map +1 -1
  23. package/cjs/dataset/DataStatistics.js +1 -2
  24. package/cjs/dataset/dataset-pivot-table.js +2 -1
  25. package/cjs/event/event.d.ts +2 -1
  26. package/cjs/event/event.js +20 -9
  27. package/cjs/event/event.js.map +1 -1
  28. package/cjs/event/listener/table-group.js +6 -10
  29. package/cjs/event/listener/table-group.js.map +1 -1
  30. package/cjs/header-helper/style.js +1 -2
  31. package/cjs/index.d.ts +1 -1
  32. package/cjs/index.js +1 -1
  33. package/cjs/index.js.map +1 -1
  34. package/cjs/layout/index.js +2 -1
  35. package/cjs/layout/pivot-header-layout.d.ts +0 -6
  36. package/cjs/layout/pivot-header-layout.js +20 -39
  37. package/cjs/layout/pivot-header-layout.js.map +1 -1
  38. package/cjs/plugins/custom-cell-style.d.ts +5 -0
  39. package/cjs/plugins/custom-cell-style.js +10 -1
  40. package/cjs/plugins/custom-cell-style.js.map +1 -1
  41. package/cjs/scenegraph/graphic/active-cell-chart-list.d.ts +2 -14
  42. package/cjs/scenegraph/graphic/active-cell-chart-list.js +75 -195
  43. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  44. package/cjs/scenegraph/graphic/chart.d.ts +1 -9
  45. package/cjs/scenegraph/graphic/chart.js +20 -48
  46. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  47. package/cjs/scenegraph/graphic/contributions/chart-render.js +4 -3
  48. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  49. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -1
  50. package/cjs/scenegraph/refresh-node/update-chart.js +1 -2
  51. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  52. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  53. package/cjs/scenegraph/scenegraph.js +12 -41
  54. package/cjs/scenegraph/scenegraph.js.map +1 -1
  55. package/cjs/state/state.js +1 -1
  56. package/cjs/tools/util.d.ts +0 -5
  57. package/cjs/tools/util.js +4 -22
  58. package/cjs/tools/util.js.map +1 -1
  59. package/cjs/ts-types/base-table.d.ts +2 -2
  60. package/cjs/ts-types/base-table.js.map +1 -1
  61. package/cjs/ts-types/events.d.ts +15 -0
  62. package/cjs/ts-types/events.js.map +1 -1
  63. package/cjs/ts-types/table-engine.d.ts +33 -13
  64. package/cjs/ts-types/table-engine.js.map +1 -1
  65. package/cjs/vrender.js.map +1 -1
  66. package/dist/vtable.js +862 -681
  67. package/dist/vtable.min.js +2 -2
  68. package/es/ListTable.d.ts +34 -7
  69. package/es/ListTable.js +130 -14
  70. package/es/ListTable.js.map +1 -1
  71. package/es/PivotChart.d.ts +0 -3
  72. package/es/PivotChart.js +4 -13
  73. package/es/PivotChart.js.map +1 -1
  74. package/es/body-helper/style.js +1 -2
  75. package/es/core/BaseTable.js +1 -1
  76. package/es/core/BaseTable.js.map +1 -1
  77. package/es/core/FouseInput.js +2 -1
  78. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  79. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  80. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  81. package/es/core/index.d.ts +1 -0
  82. package/es/core/index.js +2 -0
  83. package/es/core/index.js.map +1 -0
  84. package/es/core/record-helper.d.ts +4 -2
  85. package/es/core/record-helper.js +114 -43
  86. package/es/core/record-helper.js.map +1 -1
  87. package/es/data/DataSource.d.ts +10 -4
  88. package/es/data/DataSource.js +155 -56
  89. package/es/data/DataSource.js.map +1 -1
  90. package/es/dataset/DataStatistics.js +1 -2
  91. package/es/dataset/dataset-pivot-table.js +2 -1
  92. package/es/event/event.d.ts +2 -1
  93. package/es/event/event.js +20 -9
  94. package/es/event/event.js.map +1 -1
  95. package/es/event/listener/table-group.js +6 -9
  96. package/es/event/listener/table-group.js.map +1 -1
  97. package/es/header-helper/style.js +1 -2
  98. package/es/index.d.ts +1 -1
  99. package/es/index.js +1 -1
  100. package/es/index.js.map +1 -1
  101. package/es/layout/index.js +2 -1
  102. package/es/layout/pivot-header-layout.d.ts +0 -6
  103. package/es/layout/pivot-header-layout.js +20 -39
  104. package/es/layout/pivot-header-layout.js.map +1 -1
  105. package/es/plugins/custom-cell-style.d.ts +5 -0
  106. package/es/plugins/custom-cell-style.js +10 -1
  107. package/es/plugins/custom-cell-style.js.map +1 -1
  108. package/es/scenegraph/graphic/active-cell-chart-list.d.ts +2 -14
  109. package/es/scenegraph/graphic/active-cell-chart-list.js +68 -183
  110. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  111. package/es/scenegraph/graphic/chart.d.ts +1 -9
  112. package/es/scenegraph/graphic/chart.js +19 -47
  113. package/es/scenegraph/graphic/chart.js.map +1 -1
  114. package/es/scenegraph/graphic/contributions/chart-render.js +4 -3
  115. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  116. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -1
  117. package/es/scenegraph/refresh-node/update-chart.js +1 -2
  118. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  119. package/es/scenegraph/scenegraph.d.ts +2 -2
  120. package/es/scenegraph/scenegraph.js +11 -41
  121. package/es/scenegraph/scenegraph.js.map +1 -1
  122. package/es/state/state.js +1 -1
  123. package/es/tools/util.d.ts +0 -5
  124. package/es/tools/util.js +0 -18
  125. package/es/tools/util.js.map +1 -1
  126. package/es/ts-types/base-table.d.ts +2 -2
  127. package/es/ts-types/base-table.js.map +1 -1
  128. package/es/ts-types/events.d.ts +15 -0
  129. package/es/ts-types/events.js.map +1 -1
  130. package/es/ts-types/table-engine.d.ts +33 -13
  131. package/es/ts-types/table-engine.js.map +1 -1
  132. package/es/vrender.js.map +1 -1
  133. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/graphic/contributions/chart-render.ts"],"names":[],"mappings":";;;;;;;;;AAUA,gDAS4B;AAE5B,oCAA6C;AAC7C,+DAM+B;AAC/B,6CAA2C;AAE9B,QAAA,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACxC,QAAA,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAGtE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oBAAiB;IAAxD;;QAEL,eAAU,GAAW,yBAAiB,CAAC;IA2LzC,CAAC;IAzLC,SAAS,CACP,KAAY,EACZ,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;;QAMZ,MAAM,cAAc,GAAG,IAAA,kBAAQ,EAAC,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,KAAK,CAAC;QAE5D,MAAM,EAAE,MAAM,EAAE,I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AC,CAAC;4BAC7C,CAAC,CAAC,mCAAI,EAAE;4BACV,CAAC,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CACf,CAAC;qBACH;iBACF;gBACD,MAAA,mBAAmB,CAAC,kBAAkB,oEAAG,SAAS,CAAC,CAAC;aACrD;SAGF;aAAM;YACL,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE;gBACxC,IAAI,qCAAe,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;oBAC7E,qCAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;oBAChE,0CAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAClC;gBAED,IAAI,CAAC,IAAA,0CAAoB,GAAE,EAAE;oBAC3B,IAAA,2CAAqB,EAAC,KAAK,CAAC,CAAC;iBAC9B;aACF;iBAAM;gBACL,IAAA,iCAAW,EAAC,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;AA7LY,wBAAwB;IADpC,IAAA,oBAAU,GAAE;GACA,wBAAwB,CA6LpC;AA7LY,4DAAwB","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 { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;\n const { table } = chart.getRootNode() as any;\n\n const { cacheCanvas, activeChartInstance } = chart;\n // console.log('render chart', chart.parent.col, chart.parent.row, viewBox, cacheCanvas);\n if (!activeChartInstance && 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, activeChartInstance, chart);\n if (formatResult.needFormatSpec && formatResult.spec) {\n const spec = formatResult.spec;\n activeChartInstance.updateSpecSync(spec, false, { reuse: false, morph: false });\n // return;\n }\n }\n const lastViewBox = chart.activeChartInstanceLastViewBox; //getViewBox调用前获取上一次的viewBox,后面做判断是否变化\n const viewBox = chart.getViewBox();\n if (\n !(\n lastViewBox &&\n viewBox.x1 === lastViewBox.x1 &&\n viewBox.x2 === lastViewBox.x2 &&\n viewBox.y1 === lastViewBox.y1 &&\n viewBox.y2 === lastViewBox.y2\n )\n ) {\n // 调用updateViewBox会造成brush的drag选中框状态丢失 所以这里判断如果viewBox没有变化 则不调用updateViewBox\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 }\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' || typeof dataId === 'number') {\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/contribut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C,KAAK,EAAE,EAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF,CAAA;AAnLY,wBAAwB;IADpC,IAAA,oBAAU,GAAE;GACA,wBAAwB,CAmLpC;AAnLY,4DAAwB","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 { cacheCanvas, activeChartInstance } = chart;\n // console.log('render chart', chart.parent.col, chart.parent.row, viewBox, cacheCanvas);\n if (!activeChartInstance && 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, activeChartInstance, chart);\n if (formatResult.needFormatSpec && formatResult.spec) {\n const spec = formatResult.spec;\n activeChartInstance.updateSpecSync(spec, false, { reuse: false, morph: false });\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' || typeof dataId === 'number') {\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"]}
@@ -4,4 +4,4 @@ export declare function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph
4
4
  export declare function clearChartCacheImage(scenegraph: Scenegraph): void;
5
5
  export declare function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph): void;
6
6
  export declare function updateChartData(scenegraph: Scenegraph): void;
7
- export declare function updateChartState(scenegraph: Scenegraph, datum: any, selectedDataMode: 'click' | 'brush'): void;
7
+ export declare function updateChartState(scenegraph: Scenegraph, datum: any): void;
@@ -146,10 +146,9 @@ function updateChartData(scenegraph) {
146
146
  updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table), updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);
147
147
  }
148
148
 
149
- function updateChartState(scenegraph, datum, selectedDataMode) {
149
+ function updateChartState(scenegraph, datum) {
150
150
  const table = scenegraph.table;
151
151
  if (table.isPivotChart()) {
152
- table._selectedDataMode = selectedDataMode;
153
152
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
154
153
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
155
154
  const newSelectedDataItemsInChart = [];
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAG3C,gDAA6C;AAM7C,8CAAgD;AAChD,gDAA4C;AAG5C,SAAgB,gCAAgC,CAAC,UAAsB,EAAE,GAAW;IAClF,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;IAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,SAAiC,CAAC;IACrE,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IACn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AAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBACjC,IAAI,CAAC,OAAO,EAAE,CAAC;qBAChB;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,sBAAsB,CAAC,QAAe,EAAE,KAAa,EAAE,MAAc;IAC5E,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAc,EAAE,EAAE;QAC1C,IAAK,OAAe,CAAC,IAAI,KAAK,OAAO,EAAE;YACrC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,OAAO,CAAC,aAAa,CAAC;gBACpB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC7F,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;aAChG,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"update-chart.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const columnResizeType = col === -1 ? 'all' : table.internalProps.columnResizeType;\n if (columnResizeType === 'column') {\n const columnGroup = scenegraph.getColGroup(col);\n const columnHeaderGroup = scenegraph.getColGroup(col, true);\n const columnBottomGroup = scenegraph.getColGroupInBottom(col, true);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnHeaderGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnBottomGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n if (table.widthMode === 'adaptive' && col < table.colCount - 1) {\n const columnGroup = scenegraph.getColGroup(col + 1);\n const columnHeaderGroup = scenegraph.getColGroup(col + 1, true);\n const columnBottomGroup = scenegraph.getColGroupInBottom(col + 1, true);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnHeaderGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnBottomGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n } else {\n let startCol = table.rowHeaderLevelCount;\n let endCol = table.colCount - 1;\n let resizeIndicatorKey;\n let resizeDimensionKey;\n let resizeDimensionValue;\n if (columnResizeType === 'indicator') {\n if (layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(col, table.columnHeaderLevelCount);\n } else {\n const headerPaths = layout.getCellHeaderPaths(col, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n resizeDimensionKey = headerPath.dimensionKey;\n resizeDimensionValue = headerPath.value;\n }\n } else if (columnResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.stateManager.columnResize.col, table.columnHeaderLevelCount);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.colHeaderPaths.slice(0, headerPaths.colHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startCol = node.startInTotal + table.frozenColCount;\n endCol = node.startInTotal + table.frozenColCount + node.size - 1;\n }\n\n for (let c = startCol; c <= endCol; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n const columnHeaderGroup = scenegraph.getColGroup(c, true);\n const columnBottomGroup = scenegraph.getColGroupInBottom(c, true);\n if (columnGroup) {\n if (columnResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(c, table.columnHeaderLevelCount);\n if (layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (!layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(c, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths?.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n columnGroup.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnHeaderGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnBottomGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n }\n }\n\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = col; c <= scenegraph.proxy.colEnd; c++) {\n // const columnGroup = scenegraph.getColGroup(c);\n // // const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n // // if (chartInstance) {\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // // }\n // }\n // // 右侧冻结的单元格也需要调整\n // if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // const columnGroup = scenegraph.getColGroup(c);\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute(\n // 'width',\n // Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n // );\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // }\n // }\n}\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const state = table.stateManager;\n const rowResizeType = row === -1 ? 'all' : table.internalProps.rowResizeType;\n\n let startRow = table.columnHeaderLevelCount;\n let endRow = table.rowCount - 1;\n let resizeIndicatorKey: string;\n let resizeDimensionKey: string;\n let resizeDimensionValue: string;\n if (rowResizeType === 'indicator') {\n if (!layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(table.rowHeaderLevelCount, row);\n } else {\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount - 1, row);\n const headerPath = headerPaths.rowHeaderPaths?.[headerPaths.rowHeaderPaths.length - 1];\n resizeDimensionKey = headerPath?.dimensionKey;\n resizeDimensionValue = headerPath?.value;\n }\n } else if (rowResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount, row);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.rowHeaderPaths.slice(0, headerPaths.rowHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startRow = node.startInTotal + table.frozenRowCount;\n endRow = node.startInTotal + table.frozenRowCount + node.size - 1;\n }\n\n const colsRange = [{ startCol: scenegraph.proxy.colStart, endCol: scenegraph.proxy.colEnd }];\n if (table.frozenColCount) {\n colsRange.push({ startCol: 0, endCol: table.frozenColCount - 1 });\n }\n if (table.rightFrozenColCount) {\n colsRange.push({ startCol: table.colCount - table.rightFrozenColCount, endCol: table.colCount - 1 });\n }\n colsRange.forEach(({ startCol, endCol }) => {\n for (let col = startCol; col <= endCol; col++) {\n if (rowResizeType === 'row') {\n const cellNode = scenegraph.highPerformanceGetCell(col, row);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n\n if (table.heightMode === 'adaptive' && row < table.rowCount - 1) {\n const cellNode = scenegraph.highPerformanceGetCell(col, row + 1);\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n } else {\n for (let r = startRow; r <= endRow; r++) {\n if (rowResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(state.table.rowHeaderLevelCount, r);\n if (!layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(state.table.rowHeaderLevelCount - 1, r);\n const headerPath = headerPaths?.rowHeaderPaths[headerPaths.rowHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n const cellNode = scenegraph.highPerformanceGetCell(col, r);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n }\n }\n });\n\n // const updateCellNode = (c: number, r: number) => {\n // const cellNode = scenegraph.getCell(c, r);\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // console.log('bf', c, r, node.attribute.width, node.attribute.height);\n\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));\n // console.log('af', c, r, node.attribute.width, node.attribute.height);\n // }\n // });\n // };\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n\n // // 右侧冻结的单元格也需要调整\n // if (scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n // // 左侧冻结的单元格\n // if (scenegraph.table.frozenColCount >= 1) {\n // for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n}\n/** 清理所有chart节点的 图表缓存图片 */\nexport function clearChartCacheImage(scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n });\n }\n}\n\nexport function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n const cellGroup = scenegraph.getCell(col, row);\n cellGroup.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n}\n\n/** 更新所有的图表chart节点上缓存attribute中的data数据 */\nexport function updateChartData(scenegraph: Scenegraph) {\n const table = scenegraph.table;\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const col = cellNode.col;\n const row = cellNode.row;\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.updateData(table.getCellValue(col, row));\n const chartSpec = node.attribute.spec;\n const chartType = chartSpec.type;\n if (chartType !== 'gauge' && chartType !== 'rose' && chartType !== 'radar') {\n const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);\n node.setAttribute('axes', newAxes);\n chartSpec.axes = newAxes;\n }\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, selectedDataMode: 'click' | 'brush') {\n const table = scenegraph.table;\n if (table.isPivotChart()) {\n (table as PivotChart)._selectedDataMode = selectedDataMode;\n const preSelectItemsCount = (table as PivotChart)._selectedDataItemsInChart.length;\n if (\n (datum === null || datum === undefined || datum?.length === 0 || Object.keys(datum).length === 0) &&\n preSelectItemsCount === 0\n ) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(\n axisConfig,\n cell.attribute.width,\n cell.attribute.height,\n axisConfig.__vtableBodyChartCellPadding ?? padding,\n table\n );\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n\nfunction updateChartGraphicSize(cellNode: Group, width: number, height: number) {\n cellNode.forEachChildren((graphic: Chart) => {\n if ((graphic as any).type === 'chart') {\n graphic.cacheCanvas = null;\n graphic.setAttributes({\n width: Math.ceil(width - graphic.attribute.cellPadding[3] - graphic.attribute.cellPadding[1]),\n height: Math.ceil(height - graphic.attribute.cellPadding[0] - graphic.attribute.cellPadding[2])\n });\n }\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAG3C,gDAA6C;AAM7C,8CAAgD;AAChD,gDAA4C;AAG5C,SAAgB,gCAAgC,CAAC,UAAsB,EAAE,GAAW;IAClF,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;IAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,SAAiC,CAAC;IACrE,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IACnF,IAAI,gBAAgB,KAAK,QAAQ,EAAE;QACjC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,iBAAiB,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5D,MAAM,iBAAiB,GAAG,UAAU,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,CAAC,CAAC,QAAe,EAAE,EAAE;YAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAChD,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,eAAe,CAAC,CAAC,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SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"update-chart.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const columnResizeType = col === -1 ? 'all' : table.internalProps.columnResizeType;\n if (columnResizeType === 'column') {\n const columnGroup = scenegraph.getColGroup(col);\n const columnHeaderGroup = scenegraph.getColGroup(col, true);\n const columnBottomGroup = scenegraph.getColGroupInBottom(col, true);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnHeaderGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnBottomGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n if (table.widthMode === 'adaptive' && col < table.colCount - 1) {\n const columnGroup = scenegraph.getColGroup(col + 1);\n const columnHeaderGroup = scenegraph.getColGroup(col + 1, true);\n const columnBottomGroup = scenegraph.getColGroupInBottom(col + 1, true);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnHeaderGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnBottomGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n } else {\n let startCol = table.rowHeaderLevelCount;\n let endCol = table.colCount - 1;\n let resizeIndicatorKey;\n let resizeDimensionKey;\n let resizeDimensionValue;\n if (columnResizeType === 'indicator') {\n if (layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(col, table.columnHeaderLevelCount);\n } else {\n const headerPaths = layout.getCellHeaderPaths(col, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n resizeDimensionKey = headerPath.dimensionKey;\n resizeDimensionValue = headerPath.value;\n }\n } else if (columnResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.stateManager.columnResize.col, table.columnHeaderLevelCount);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.colHeaderPaths.slice(0, headerPaths.colHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startCol = node.startInTotal + table.frozenColCount;\n endCol = node.startInTotal + table.frozenColCount + node.size - 1;\n }\n\n for (let c = startCol; c <= endCol; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n const columnHeaderGroup = scenegraph.getColGroup(c, true);\n const columnBottomGroup = scenegraph.getColGroupInBottom(c, true);\n if (columnGroup) {\n if (columnResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(c, table.columnHeaderLevelCount);\n if (layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (!layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(c, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths?.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n columnGroup.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnHeaderGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n columnBottomGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n }\n }\n\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = col; c <= scenegraph.proxy.colEnd; c++) {\n // const columnGroup = scenegraph.getColGroup(c);\n // // const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n // // if (chartInstance) {\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // // }\n // }\n // // 右侧冻结的单元格也需要调整\n // if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // const columnGroup = scenegraph.getColGroup(c);\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute(\n // 'width',\n // Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n // );\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // }\n // }\n}\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const state = table.stateManager;\n const rowResizeType = row === -1 ? 'all' : table.internalProps.rowResizeType;\n\n let startRow = table.columnHeaderLevelCount;\n let endRow = table.rowCount - 1;\n let resizeIndicatorKey: string;\n let resizeDimensionKey: string;\n let resizeDimensionValue: string;\n if (rowResizeType === 'indicator') {\n if (!layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(table.rowHeaderLevelCount, row);\n } else {\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount - 1, row);\n const headerPath = headerPaths.rowHeaderPaths?.[headerPaths.rowHeaderPaths.length - 1];\n resizeDimensionKey = headerPath?.dimensionKey;\n resizeDimensionValue = headerPath?.value;\n }\n } else if (rowResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount, row);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.rowHeaderPaths.slice(0, headerPaths.rowHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startRow = node.startInTotal + table.frozenRowCount;\n endRow = node.startInTotal + table.frozenRowCount + node.size - 1;\n }\n\n const colsRange = [{ startCol: scenegraph.proxy.colStart, endCol: scenegraph.proxy.colEnd }];\n if (table.frozenColCount) {\n colsRange.push({ startCol: 0, endCol: table.frozenColCount - 1 });\n }\n if (table.rightFrozenColCount) {\n colsRange.push({ startCol: table.colCount - table.rightFrozenColCount, endCol: table.colCount - 1 });\n }\n colsRange.forEach(({ startCol, endCol }) => {\n for (let col = startCol; col <= endCol; col++) {\n if (rowResizeType === 'row') {\n const cellNode = scenegraph.highPerformanceGetCell(col, row);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n\n if (table.heightMode === 'adaptive' && row < table.rowCount - 1) {\n const cellNode = scenegraph.highPerformanceGetCell(col, row + 1);\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n } else {\n for (let r = startRow; r <= endRow; r++) {\n if (rowResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(state.table.rowHeaderLevelCount, r);\n if (!layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(state.table.rowHeaderLevelCount - 1, r);\n const headerPath = headerPaths?.rowHeaderPaths[headerPaths.rowHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n const cellNode = scenegraph.highPerformanceGetCell(col, r);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n }\n }\n });\n\n // const updateCellNode = (c: number, r: number) => {\n // const cellNode = scenegraph.getCell(c, r);\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // console.log('bf', c, r, node.attribute.width, node.attribute.height);\n\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));\n // console.log('af', c, r, node.attribute.width, node.attribute.height);\n // }\n // });\n // };\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n\n // // 右侧冻结的单元格也需要调整\n // if (scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n // // 左侧冻结的单元格\n // if (scenegraph.table.frozenColCount >= 1) {\n // for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n}\n/** 清理所有chart节点的 图表缓存图片 */\nexport function clearChartCacheImage(scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n });\n }\n}\n\nexport function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n const cellGroup = scenegraph.getCell(col, row);\n cellGroup.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n}\n\n/** 更新所有的图表chart节点上缓存attribute中的data数据 */\nexport function updateChartData(scenegraph: Scenegraph) {\n const table = scenegraph.table;\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const col = cellNode.col;\n const row = cellNode.row;\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.updateData(table.getCellValue(col, row));\n const chartSpec = node.attribute.spec;\n const chartType = chartSpec.type;\n if (chartType !== 'gauge' && chartType !== 'rose' && chartType !== 'radar') {\n const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);\n node.setAttribute('axes', newAxes);\n chartSpec.axes = newAxes;\n }\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 (\n (datum === null || datum === undefined || datum?.length === 0 || Object.keys(datum).length === 0) &&\n preSelectItemsCount === 0\n ) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(\n axisConfig,\n cell.attribute.width,\n cell.attribute.height,\n axisConfig.__vtableBodyChartCellPadding ?? padding,\n table\n );\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n\nfunction updateChartGraphicSize(cellNode: Group, width: number, height: number) {\n cellNode.forEachChildren((graphic: Chart) => {\n if ((graphic as any).type === 'chart') {\n graphic.cacheCanvas = null;\n graphic.setAttributes({\n width: Math.ceil(width - graphic.attribute.cellPadding[3] - graphic.attribute.cellPadding[1]),\n height: Math.ceil(height - graphic.attribute.cellPadding[0] - graphic.attribute.cellPadding[2])\n });\n }\n });\n}\n"]}
@@ -99,7 +99,7 @@ export declare class Scenegraph {
99
99
  setIconNormalStyle(icon: Icon, col: number, row: number): void;
100
100
  residentHoverIcon(col: number, row: number): void;
101
101
  resetResidentHoverIcon(col: number, row: number): void;
102
- deactivateChart(col: number, row: number, forceRelease?: boolean): void;
102
+ deactivateChart(col: number, row: number): void;
103
103
  activateChart(col: number, row: number): any;
104
104
  removeInteractionBorder(col: number, row: number): void;
105
105
  createCellSelectBorder(start_Col: number, start_Row: number, end_Col: number, end_Row: number, selectRangeType: CellSubLocation, selectId: string, strokes?: boolean[]): void;
@@ -114,7 +114,7 @@ export declare class Scenegraph {
114
114
  updateColWidth(col: number, detaX: number, skipUpdateContainer?: boolean, skipTableWidthMap?: boolean): void;
115
115
  updateChartSizeForResizeColWidth(col: number): void;
116
116
  updateChartSizeForResizeRowHeight(row: number): void;
117
- updateChartState(datum: any, selectedDataMode: 'click' | 'brush'): void;
117
+ updateChartState(datum: any): void;
118
118
  updateCheckboxCellState(col: number, row: number, checked: boolean | 'indeterminate'): void;
119
119
  updateHeaderCheckboxCellState(col: number, row: number, checked: boolean | 'indeterminate'): void;
120
120
  updateAutoColWidth(col: number): void;
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "__esModule", {
33
33
  value: !0
34
34
  }), exports.Scenegraph = void 0;
35
35
 
36
- const vrender_1 = require("./../vrender"), ts_types_1 = require("../ts-types"), get_cell_merge_1 = require("./utils/get-cell-merge"), update_width_1 = require("./layout/update-width"), table_component_1 = require("./component/table-component"), update_height_1 = require("./layout/update-height"), image_cell_1 = require("./group-creater/cell-type/image-cell"), padding_1 = require("./utils/padding"), frame_border_1 = require("./style/frame-border"), contributions_1 = __importDefault(require("./graphic/contributions")), get_prop_1 = require("./utils/get-prop"), text_icon_layout_1 = require("./utils/text-icon-layout"), proxy_1 = require("./group-creater/progress/proxy"), compute_col_width_1 = require("./layout/compute-col-width"), move_cell_1 = require("./layout/move-cell"), cell_helper_1 = require("./group-creater/cell-helper"), update_select_border_1 = require("./select/update-select-border"), create_select_border_1 = require("./select/create-select-border"), move_select_border_1 = require("./select/move-select-border"), delete_select_border_1 = require("./select/delete-select-border"), update_row_1 = require("./layout/update-row"), stick_text_1 = require("./stick-text"), compute_row_height_1 = require("./layout/compute-row-height"), empty_group_1 = require("./utils/empty-group"), frozen_1 = require("./layout/frozen"), update_chart_1 = require("./refresh-node/update-chart"), init_scenegraph_1 = require("./group-creater/init-scenegraph"), update_container_1 = require("./utils/update-container"), vrender_2 = require("./../vrender"), text_measure_1 = __importDefault(require("./utils/text-measure")), icon_update_1 = require("./icon/icon-update"), env_1 = require("../tools/env"), corner_cell_1 = require("./style/corner-cell"), update_col_1 = require("./layout/update-col"), util_1 = require("../tools/util"), appear_1 = require("./animation/appear"), frozen_react_1 = require("./layout/frozen-react"), registerIcons = __importStar(require("../icons")), update_select_style_1 = require("./select/update-select-style"), TABLE_EVENT_TYPE_1 = require("../core/TABLE_EVENT_TYPE"), util_2 = require("../event/util"), active_cell_chart_list_1 = require("./graphic/active-cell-chart-list");
36
+ const vrender_1 = require("./../vrender"), ts_types_1 = require("../ts-types"), get_cell_merge_1 = require("./utils/get-cell-merge"), update_width_1 = require("./layout/update-width"), table_component_1 = require("./component/table-component"), update_height_1 = require("./layout/update-height"), image_cell_1 = require("./group-creater/cell-type/image-cell"), padding_1 = require("./utils/padding"), frame_border_1 = require("./style/frame-border"), contributions_1 = __importDefault(require("./graphic/contributions")), get_prop_1 = require("./utils/get-prop"), text_icon_layout_1 = require("./utils/text-icon-layout"), proxy_1 = require("./group-creater/progress/proxy"), compute_col_width_1 = require("./layout/compute-col-width"), move_cell_1 = require("./layout/move-cell"), cell_helper_1 = require("./group-creater/cell-helper"), update_select_border_1 = require("./select/update-select-border"), create_select_border_1 = require("./select/create-select-border"), move_select_border_1 = require("./select/move-select-border"), delete_select_border_1 = require("./select/delete-select-border"), update_row_1 = require("./layout/update-row"), stick_text_1 = require("./stick-text"), compute_row_height_1 = require("./layout/compute-row-height"), empty_group_1 = require("./utils/empty-group"), frozen_1 = require("./layout/frozen"), update_chart_1 = require("./refresh-node/update-chart"), init_scenegraph_1 = require("./group-creater/init-scenegraph"), update_container_1 = require("./utils/update-container"), vrender_2 = require("./../vrender"), text_measure_1 = __importDefault(require("./utils/text-measure")), icon_update_1 = require("./icon/icon-update"), env_1 = require("../tools/env"), corner_cell_1 = require("./style/corner-cell"), update_col_1 = require("./layout/update-col"), util_1 = require("../tools/util"), appear_1 = require("./animation/appear"), frozen_react_1 = require("./layout/frozen-react"), registerIcons = __importStar(require("../icons")), update_select_style_1 = require("./select/update-select-style"), TABLE_EVENT_TYPE_1 = require("../core/TABLE_EVENT_TYPE"), util_2 = require("../event/util");
37
37
 
38
38
  (0, vrender_1.registerForVrender)(), vrender_1.container.load(contributions_1.default),
39
39
  vrender_1.container.load(text_measure_1.default);
@@ -314,37 +314,16 @@ class Scenegraph {
314
314
  resetResidentHoverIcon(col, row) {
315
315
  (0, icon_update_1.resetResidentHoverIcon)(col, row, this);
316
316
  }
317
- deactivateChart(col, row, forceRelease = !1) {
318
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
319
- if (-1 === col || -1 === row) {
320
- if (forceRelease) {
321
- const brushingChartInstanceCellPos = (0, active_cell_chart_list_1.getBrushingChartInstanceCellPos)(), cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
322
- (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && ((0,
323
- active_cell_chart_list_1.clearBrushingChartInstance)(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
324
- forceRelease: !0,
325
- releaseChartInstance: !0,
326
- releaseColumnChartInstance: !0,
327
- releaseRowChartInstance: !0,
328
- releaseAllChartInstance: !0
329
- }));
330
- }
331
- return;
332
- }
317
+ deactivateChart(col, row) {
318
+ var _a, _b, _c;
319
+ if (-1 === col || -1 === row) return;
333
320
  const cellGroup = this.getCell(col, row);
334
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
335
- if (forceRelease) return (0, active_cell_chart_list_1.clearBrushingChartInstance)(),
336
- void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
337
- forceRelease: !0,
338
- releaseChartInstance: !0,
339
- releaseColumnChartInstance: !0,
340
- releaseRowChartInstance: !0,
341
- releaseAllChartInstance: !0
342
- }));
321
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
343
322
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
344
- null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
345
- releaseChartInstance: "pie" !== chartType && ("scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
346
- releaseColumnChartInstance: "pie" !== chartType && (col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
347
- releaseRowChartInstance: "pie" !== chartType && (row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount)
323
+ null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, this.table.options.chartDimensionLinkage ? {
324
+ releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
325
+ releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
326
+ releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
348
327
  } : void 0);
349
328
  }
350
329
  }
@@ -395,16 +374,8 @@ class Scenegraph {
395
374
  updateChartSizeForResizeRowHeight(row) {
396
375
  (0, update_chart_1.updateChartSizeForResizeRowHeight)(this, row);
397
376
  }
398
- updateChartState(datum, selectedDataMode) {
399
- var _a, _b;
400
- if (this.table.isPivotChart()) {
401
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
402
- const brushingChartInstance = (0, active_cell_chart_list_1.getBrushingChartInstance)();
403
- brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(),
404
- null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
405
- }
406
- (0, update_chart_1.updateChartState)(this, datum, selectedDataMode);
407
- }
377
+ updateChartState(datum) {
378
+ this.table.isPivotChart() && (0, update_chart_1.updateChartState)(this, datum);
408
379
  }
409
380
  updateCheckboxCellState(col, row, checked) {
410
381
  var _a, _b;
@@ -988,4 +959,4 @@ class Scenegraph {
988
959
  }
989
960
 
990
961
  exports.Scenegraph = Scenegraph;
991
- //# sourceMappingURL=scenegraph.js.map
962
+ //# sourceMappingURL=scenegraph.js.map