@visactor/vtable 1.22.5-alpha.0 → 1.22.5-alpha.2

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 (61) hide show
  1. package/cjs/PivotChart.js +4 -4
  2. package/cjs/PivotChart.js.map +1 -1
  3. package/cjs/core/BaseTable.js +1 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/core/style-helper.js +1 -2
  6. package/cjs/dataset/dataset-pivot-table.js +2 -1
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/layout/chart-helper/get-axis-config.js +14 -10
  11. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  12. package/cjs/layout/chart-helper/get-chart-spec.js +6 -2
  13. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  14. package/cjs/layout/pivot-header-layout.js +20 -4
  15. package/cjs/layout/pivot-header-layout.js.map +1 -1
  16. package/cjs/plugins/index.js +1 -1
  17. package/cjs/scenegraph/graphic/active-cell-chart-list.js +18 -2
  18. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  19. package/cjs/scenegraph/graphic/chart.d.ts +3 -0
  20. package/cjs/scenegraph/graphic/chart.js +53 -19
  21. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  22. package/cjs/scenegraph/refresh-node/update-chart.js +1 -1
  23. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  24. package/cjs/ts-types/theme.d.ts +4 -4
  25. package/cjs/ts-types/theme.js.map +1 -1
  26. package/cjs/vrender.js.map +1 -1
  27. package/dist/vtable.js +18064 -17887
  28. package/dist/vtable.min.js +2 -2
  29. package/es/PivotChart.js +4 -4
  30. package/es/PivotChart.js.map +1 -1
  31. package/es/core/BaseTable.js +1 -1
  32. package/es/core/BaseTable.js.map +1 -1
  33. package/es/core/style-helper.js +1 -2
  34. package/es/dataset/dataset-pivot-table.js +2 -1
  35. package/es/index.d.ts +1 -1
  36. package/es/index.js +1 -1
  37. package/es/index.js.map +1 -1
  38. package/es/layout/chart-helper/get-axis-config.js +14 -10
  39. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  40. package/es/layout/chart-helper/get-chart-spec.js +5 -3
  41. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  42. package/es/layout/pivot-header-layout.js +20 -4
  43. package/es/layout/pivot-header-layout.js.map +1 -1
  44. package/es/plugins/index.js +1 -1
  45. package/es/scenegraph/graphic/active-cell-chart-list.js +18 -2
  46. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  47. package/es/scenegraph/graphic/chart.d.ts +3 -0
  48. package/es/scenegraph/graphic/chart.js +52 -18
  49. package/es/scenegraph/graphic/chart.js.map +1 -1
  50. package/es/scenegraph/refresh-node/update-chart.js +1 -1
  51. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  52. package/es/ts-types/theme.d.ts +4 -4
  53. package/es/ts-types/theme.js.map +1 -1
  54. package/es/vrender.js.map +1 -1
  55. package/package.json +4 -4
  56. package/cjs/layout/pivot-layout.d.ts +0 -1
  57. package/cjs/layout/pivot-layout.js +0 -1
  58. package/cjs/layout/pivot-layout.js.map +0 -1
  59. package/es/layout/pivot-layout.d.ts +0 -1
  60. package/es/layout/pivot-layout.js +0 -1
  61. package/es/layout/pivot-layout.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,UAAU,gCAAgC,CAAC,UAAsB,EAAE,GAAW;IAClF,MAAM,EAAE,KAAK,EAAE,GAAG,UA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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;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) {\n const table = scenegraph.table;\n if (table.isPivotChart()) {\n const preSelectItemsCount = (table as PivotChart)._selectedDataItemsInChart.length;\n if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(\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,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,UAAU,gCAAgC,CAAC,UAAsB,EAAE,GAAW;IAClF,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;IAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,SAAiC,CAAC;IACrE,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;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,M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C,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) {\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"]}
@@ -126,16 +126,16 @@ export interface ITableThemeDefine {
126
126
  axisStyle?: {
127
127
  defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;
128
128
  leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
129
- cellPaddingLeft: number;
129
+ cellPaddingLeft?: number;
130
130
  };
131
131
  rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
132
- cellPaddingRight: number;
132
+ cellPaddingRight?: number;
133
133
  };
134
134
  topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
135
- cellPaddingTop: number;
135
+ cellPaddingTop?: number;
136
136
  };
137
137
  bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
138
- cellPaddingBottom: number;
138
+ cellPaddingBottom?: number;
139
139
  };
140
140
  };
141
141
  checkboxStyle?: CheckboxStyle;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine, LineDashsPropertyDefine } from '.';\nimport type { ButtonStyle, CheckboxStyle, ITextStyleOption, RadioStyle, SwitchStyle } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from './../vrender';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n select?: {\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n };\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number | [number, number, number, number]; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条滑块的圆角半径 */\n scrollSliderCornerRadius?: number;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 。默认'scrolling'*/\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n horizontalVisible?: 'always' | 'scrolling' | 'none' | 'focus';\n verticalVisible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n /** 是否显示到容器的边缘 尽管内容没有撑满的情况下 默认false */\n barToSide?: boolean;\n /** 横向滚动条 padding */\n horizontalPadding?: number | [number, number, number, number];\n /** 竖向滚动条 padding */\n verticalPadding?: number | [number, number, number, number];\n ignoreFrozenCols?: boolean; // 忽略所有冻结列宽度,默认false\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n maxWidth?: number;\n maxHeight?: number;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n groupTitleStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n visibleOnHover?: boolean; //是否在hover时显示\n lineColor?: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth?: number; //上面线的宽度\n width?: number; //背景线的宽度\n resizeHotSpotSize?: number; //响应调整行高列宽交互行为热区的大小\n labelVisible?: boolean; //是否显示label\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 。默认'scrolling'*/\n visible?: 'always' | 'scrolling';\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n inlineRowBgColor?: string; //交互所在整行的背景颜色\n inlineColumnBgColor?: string; //交互所在整列的背景颜色\n selectionFillMode?: 'overlay' | 'replace'; //选择框填充模式,overlay表示选择框背景色覆盖在表格上(需要配饰透明度),replace表示背景色替换原有单元格的背景色\n dynamicUpdateSelectionSize?: boolean; // 选择框大小随滚动动态变化,用于冻结并且背景透明的场景,默认false,开启后性能会有一定影响\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingLeft: number;\n };\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingRight: number;\n };\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingTop: number;\n };\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingBottom: number;\n };\n };\n\n checkboxStyle?: CheckboxStyle;\n radioStyle?: RadioStyle;\n switchStyle?: SwitchStyle;\n buttonStyle?: ButtonStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 表格四侧单元格,靠近边缘的border是否需要再绘制;如配置false的话,当表格左侧frame未设置情况下左侧单元格不显示左边框,其他方向同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n /** 内部功能性按钮图标颜色及尺寸配置 */\n functionalIconsStyle?: {\n sort_color?: string;\n sort_color_opacity?: string;\n sort_color_2?: string;\n sort_color_opacity_2?: string;\n sort_size?: number;\n sort_size_2?: number;\n frozen_color?: string;\n frozen_color_opacity?: string;\n frozen_color_2?: string;\n frozen_color_opacity_2?: string;\n frozen_size?: number;\n frozen_size_2?: number;\n collapse_color?: string;\n collapse_color_opacity?: string;\n collapse_size?: number;\n collapse_size_2?: number;\n expand_color?: string;\n expand_color_opacity?: string;\n expand_size?: number;\n expand_size_2?: number;\n dragReorder_color?: string;\n dragReorder_color_opacity?: string;\n dragReorder_size?: number;\n };\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
1
+ {"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine, LineDashsPropertyDefine } from '.';\nimport type { ButtonStyle, CheckboxStyle, ITextStyleOption, RadioStyle, SwitchStyle } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from './../vrender';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n select?: {\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n };\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number | [number, number, number, number]; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条滑块的圆角半径 */\n scrollSliderCornerRadius?: number;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 。默认'scrolling'*/\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n horizontalVisible?: 'always' | 'scrolling' | 'none' | 'focus';\n verticalVisible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n /** 是否显示到容器的边缘 尽管内容没有撑满的情况下 默认false */\n barToSide?: boolean;\n /** 横向滚动条 padding */\n horizontalPadding?: number | [number, number, number, number];\n /** 竖向滚动条 padding */\n verticalPadding?: number | [number, number, number, number];\n ignoreFrozenCols?: boolean; // 忽略所有冻结列宽度,默认false\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n maxWidth?: number;\n maxHeight?: number;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n groupTitleStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n visibleOnHover?: boolean; //是否在hover时显示\n lineColor?: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth?: number; //上面线的宽度\n width?: number; //背景线的宽度\n resizeHotSpotSize?: number; //响应调整行高列宽交互行为热区的大小\n labelVisible?: boolean; //是否显示label\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 。默认'scrolling'*/\n visible?: 'always' | 'scrolling';\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n inlineRowBgColor?: string; //交互所在整行的背景颜色\n inlineColumnBgColor?: string; //交互所在整列的背景颜色\n selectionFillMode?: 'overlay' | 'replace'; //选择框填充模式,overlay表示选择框背景色覆盖在表格上(需要配饰透明度),replace表示背景色替换原有单元格的背景色\n dynamicUpdateSelectionSize?: boolean; // 选择框大小随滚动动态变化,用于冻结并且背景透明的场景,默认false,开启后性能会有一定影响\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingLeft?: number;\n };\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingRight?: number;\n };\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingTop?: number;\n };\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {\n cellPaddingBottom?: number;\n };\n };\n\n checkboxStyle?: CheckboxStyle;\n radioStyle?: RadioStyle;\n switchStyle?: SwitchStyle;\n buttonStyle?: ButtonStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 表格四侧单元格,靠近边缘的border是否需要再绘制;如配置false的话,当表格左侧frame未设置情况下左侧单元格不显示左边框,其他方向同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n /** 内部功能性按钮图标颜色及尺寸配置 */\n functionalIconsStyle?: {\n sort_color?: string;\n sort_color_opacity?: string;\n sort_color_2?: string;\n sort_color_opacity_2?: string;\n sort_size?: number;\n sort_size_2?: number;\n frozen_color?: string;\n frozen_color_opacity?: string;\n frozen_color_2?: string;\n frozen_color_opacity_2?: string;\n frozen_size?: number;\n frozen_size_2?: number;\n collapse_color?: string;\n collapse_color_opacity?: string;\n collapse_size?: number;\n collapse_size_2?: number;\n expand_color?: string;\n expand_color_opacity?: string;\n expand_size?: number;\n expand_size_2?: number;\n dragReorder_color?: string;\n dragReorder_color_opacity?: string;\n dragReorder_size?: number;\n };\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
package/es/vrender.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACxH,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,EAGX,cAAc,EAEd,aAAa,EACb,aAAa,EACb,YAAY,EAIZ,YAAY,EAEZ,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IAGd,cAAc,EAAE,CAAC;IAEjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IAIf,YAAY,EAAE,CAAC;IAEf,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,wBAAwB,EAAE,CAAC;IAE3B,UAAU,EAAE,CAAC;IAEb,wBAAwB,EAAE,CAAC;AAC7B,CAAC;AAOD,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule, registerFlexLayoutPlugin } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.22.5-alpha.0\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n // registerArc3d();\n // registerArea();\n registerCircle();\n // registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n // registerPath();\n // registerPolygon();\n // registerPyramid3d();\n registerRect();\n // registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerFlexLayoutPlugin();\n // registerWrapText();\n loadPoptip();\n\n registerFlexLayoutPlugin();\n}\n\nexport type { Direction } from '@visactor/vrender-core';\nexport type { State } from '@visactor/vrender-components';\n// export { GroupFadeIn } from '@visactor/vrender-core';\n// export { GroupFadeOut } from '@visactor/vrender-core';\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-components';\nexport * from '@visactor/vrender-animate';\n"]}
1
+ {"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACxH,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,EAGX,cAAc,EAEd,aAAa,EACb,aAAa,EACb,YAAY,EAIZ,YAAY,EAEZ,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IAGd,cAAc,EAAE,CAAC;IAEjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IAIf,YAAY,EAAE,CAAC;IAEf,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,wBAAwB,EAAE,CAAC;IAE3B,UAAU,EAAE,CAAC;IAEb,wBAAwB,EAAE,CAAC;AAC7B,CAAC;AAOD,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule, registerFlexLayoutPlugin } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.22.5-alpha.2\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n // registerArc3d();\n // registerArea();\n registerCircle();\n // registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n // registerPath();\n // registerPolygon();\n // registerPyramid3d();\n registerRect();\n // registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerFlexLayoutPlugin();\n // registerWrapText();\n loadPoptip();\n\n registerFlexLayoutPlugin();\n}\n\nexport type { Direction } from '@visactor/vrender-core';\nexport type { State } from '@visactor/vrender-components';\n// export { GroupFadeIn } from '@visactor/vrender-core';\n// export { GroupFadeOut } from '@visactor/vrender-core';\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-components';\nexport * from '@visactor/vrender-animate';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vtable",
3
- "version": "1.22.5-alpha.0",
3
+ "version": "1.22.5-alpha.2",
4
4
  "description": "canvas table width high performance",
5
5
  "keywords": [
6
6
  "grid",
@@ -37,7 +37,7 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@visactor/vtable-editors": "1.22.5-alpha.0",
40
+ "@visactor/vtable-editors": "1.22.5-alpha.2",
41
41
  "@visactor/vrender-core": "1.0.27-alpha.0",
42
42
  "@visactor/vrender-kits": "1.0.27-alpha.0",
43
43
  "@visactor/vrender-components": "1.0.27-alpha.0",
@@ -101,9 +101,9 @@
101
101
  "d3-hierarchy": "^3.1.1",
102
102
  "@resvg/resvg-js": "^2.5.0",
103
103
  "pikaday": "1.8.2",
104
- "@internal/eslint-config": "0.0.1",
105
104
  "@internal/ts-config": "0.0.1",
106
- "@internal/bundler": "0.0.1"
105
+ "@internal/bundler": "0.0.1",
106
+ "@internal/eslint-config": "0.0.1"
107
107
  },
108
108
  "unpkg": "latest",
109
109
  "unpkgFiles": [
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
- //# sourceMappingURL=pivot-layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/layout/pivot-layout.ts"],"names":[],"mappings":"","file":"pivot-layout.js","sourcesContent":["// import type { Dataset } from '../dataset/dataset';\n// import { isValid, transpose } from '../tools/util';\n// import type { HeaderData, IndicatorData, LayoutMapAPI, WidthData } from '../ts-types/list-table/layout-map/api';\n// // import { EmptyDataCache } from './utils';\n// import {\n// type CellAddress,\n// type CellRange,\n// type CellLocation,\n// type ICornerDefine,\n// type IDataConfig,\n// type IDimension,\n// type IDimensionInfo,\n// type IHeaderTreeDefine,\n// type IIndicator,\n// type IPivotTableCellHeaderPaths,\n// type ITitleDefine,\n// type LayoutObjectId,\n// type ShowColumnRowType,\n// HierarchyState\n// } from '../ts-types';\n// import type { PivotTable } from '../PivotTable';\n// import { IndicatorDimensionKeyPlaceholder } from '../tools/global';\n// import type { PivotChart } from '../PivotChart';\n// import { cloneDeep, isArray } from '@visactor/vutils';\n// import { getAxisConfigInPivotChart } from './chart-helper/get-axis-config';\n// import { getChartAxes, getChartDataId, getChartSpec, getRawChartSpec } from './chart-helper/get-chart-spec';\n// import type { ITableAxisOption } from '../ts-types/component/axis';\n// import { DimensionTree, type IPivotLayoutHeadNode } from './pivot-layout-helper';\n// import type { ILinkDimension } from '../ts-types/pivot-table/dimension/link-dimension';\n// import type { IImageDimension } from '../ts-types/pivot-table/dimension/image-dimension';\n\n// export const sharedVar = { seqId: 0 };\n// let colIndex = 0;\n\n// import type { TextStyle } from '../body-helper/style';\n// import { getQuadProps } from '../scenegraph/utils/padding';\n// /**\n// * 简化配置,包含数据处理的 布局辅助计算类\n// */\n\n// const EMPTY_HEADER: HeaderData = {\n// isEmpty: true,\n// id: undefined,\n// field: undefined,\n// headerType: undefined,\n// define: undefined\n// };\n// export class PivotLayoutMap implements LayoutMapAPI {\n// private _headerObjects: HeaderData[] = [];\n// private _headerObjectMap: { [key: LayoutObjectId]: HeaderData } = {};\n// // private _emptyDataCache = new EmptyDataCache();\n// private _indicatorObjects: IndicatorData[] = [];\n// private _columnWidths: WidthData[] = [];\n// rowDimensionTree: DimensionTree;\n// rowTree: IHeaderTreeDefine[];\n// columnTree: IHeaderTreeDefine[];\n// rowsDefine: (IDimension | string)[];\n// columnsDefine: (IDimension | string)[];\n// indicatorsDefine: (IIndicator | string)[];\n\n// indicatorKeys: string[];\n\n// _showRowHeader = true;\n// _showColumnHeader = true;\n// _rowHeaderTitle: ITitleDefine;\n// _columnHeaderTitle: ITitleDefine;\n// // transpose: boolean = false;\n// /**\n// * 通过indicatorsAsCol和hideIndicatorName判断指标值显示在column还是row 还是根本不显示\n// */\n// private _indicatorShowType: ShowColumnRowType = 'column';\n// indicatorsAsCol = true;\n// hideIndicatorName = false;\n// indicatorDimensionKey: string = IndicatorDimensionKeyPlaceholder;\n// indicatorTitle: string;\n// /**\n// * 对应dataset中的rowKeys,行表头的每行表头键值,包含小计总计\n// */\n// private rowKeysPath: string[][];\n// /**\n// * 对应dataset中的colKeys,列表头的每列表头键值,包含小计总计\n// */\n// private colKeysPath: string[][];\n// /**\n// * 通过colKeys的二维数组,转置得到。这样就对应单元格横向结构\n// */\n// private convertColKeys: string[][];\n\n// /**\n// * 对应dataset中的rowAttrs,行表头对应的维度名\n// */\n// rows: string[];\n// /**\n// * 对应dataset中的colAttrs,列表头对应的维度名\n// */\n// columns: string[];\n// /**\n// * rowAttrs和指标显示的结合,如果指标显示在行表头,这里会比rowAttrs多一个值\n// */\n// private rowShowAttrs: string[];\n// /**\n// * rowAttrs和指标显示的结合,如果指标显示在列表头,这里会比colAttrs多一个值\n// */\n// private colShowAttrs: string[];\n// /**\n// * 对应dataset中的tree,body每一个单元格对应的计算结果\n// */\n// tree: any;\n\n// dataset: Dataset;\n// dataConfig: IDataConfig;\n\n// _rowCount: number;\n// _colCount: number;\n// _bodyRowCount: number;\n\n// // dimensions: IDimension[];\n// cornerSetting: ICornerDefine;\n// _table: PivotTable | PivotChart;\n\n// /**层级维度结构显示形式 */\n// rowHierarchyType?: 'grid' | 'tree';\n// rowExpandLevel?: number;\n// rowHierarchyIndent?: number;\n// //#region pivotChart专有\n// hasTwoIndicatorAxes: boolean;\n// /** 图表spec中barWidth的收集 */\n// _chartItemSpanSize: number;\n// _chartPaddingInner: number;\n// _chartPaddingOuter: number;\n// _chartItemBandSize: number;\n// _chartPadding?: number | number[];\n// constructor(table: PivotTable | PivotChart, dataset: Dataset) {\n// this._table = table;\n// this._chartItemSpanSize = 0;\n// this._chartItemBandSize = 0;\n// this.rowHierarchyType = (table as PivotTable).options.rowHierarchyType;\n// this.rowExpandLevel = (table as PivotTable).options.rowExpandLevel ?? 1;\n// this.rowHierarchyIndent = (table as PivotTable).options.rowHierarchyIndent ?? 20;\n// this.rowTree = table.options.rowTree;\n// this.columnTree = table.options.columnTree;\n// this.rowsDefine = table.options.rows ?? [];\n// this.columnsDefine = table.options.columns ?? [];\n// this.indicatorsDefine = table.options.indicators ?? [];\n// this.indicatorTitle = table.options.indicatorTitle;\n// this.dataset = dataset;\n// this.dataConfig = dataset.dataConfig;\n// this.indicatorKeys = dataset.indicatorKeys;\n// this.indicatorsAsCol = table.options.indicatorsAsCol ?? true;\n// this.hideIndicatorName = table.options.hideIndicatorName ?? false;\n// this.showRowHeader = table.options.showRowHeader ?? true;\n// this.showColumnHeader = table.options.showColumnHeader ?? true;\n// this.rowHeaderTitle = table.options.rowHeaderTitle;\n// this.columnHeaderTitle = table.options.columnHeaderTitle;\n// // this.dimensions = [];\n// this.cornerSetting = table.options.corner ?? { titleOnDimension: 'column' };\n\n// this.columns = dataset.columns;\n// this.rows = dataset.rows;\n// this.rowKeysPath = dataset.rowKeysPath;\n// this.colKeysPath = dataset.colKeysPath;\n\n// this.tree = dataset.tree;\n\n// if (!this.rowTree) {\n// this.rowTree = dataset.rowHeaderTree;\n// this.rowDimensionTree = new DimensionTree(\n// (this.rowTree as IPivotLayoutHeadNode[]) ?? [],\n// this.rowHierarchyType,\n// this.rowExpandLevel\n// );\n// const _headerCellIds: any[] = [];\n// this._addHeadersForTreeMode(\n// this.rowKeysPath,\n// 0,\n// this.rowDimensionTree.tree.children,\n// [],\n// this.rowDimensionTree.totalLevel,\n// true,\n// this.rowsDefine\n// );\n// this.rowKeysPath = transpose(this.rowKeysPath);\n// this._headerObjectMap = this._headerObjects.reduce((o, e) => {\n// o[e.id as number] = e;\n// return o;\n// }, {} as { [key: LayoutObjectId]: HeaderData });\n// }\n// this.initState();\n// this.convertColKeys = transpose(this.colKeysPath);\n// }\n// /**\n// * 初始化该类的计算变量\n// */\n// private initState() {\n// if (this.indicatorsAsCol && !this.hideIndicatorName) {\n// this._indicatorShowType = 'column';\n// } else if (!this.indicatorsAsCol && !this.hideIndicatorName) {\n// this._indicatorShowType = 'row';\n// } else {\n// this._indicatorShowType = 'none';\n// }\n\n// this.colShowAttrs =\n// this._indicatorShowType === 'column' ? this.columns.concat(this.indicatorDimensionKey) : Array.from(this.columns);\n// this.rowShowAttrs =\n// this._indicatorShowType === 'row' ? this.rows.concat(this.indicatorDimensionKey) : Array.from(this.rows);\n\n// this._bodyRowCount = this.rowKeysPath.length * (!this.indicatorsAsCol ? this.indicatorKeys.length : 1);\n// this.initHeaderObjects();\n// this.initIndicatorObjects();\n// //#region 处理headerTitle\n// if (this.rowHeaderTitle) {\n// const cell_id = 'rowHeaderTitle';\n// const title =\n// typeof this.rowHeaderTitle.title === 'string'\n// ? this.rowHeaderTitle.title\n// : (this.rowsDefine.reduce((title: string, value) => {\n// if (typeof value === 'string') {\n// return title;\n// }\n// return title + (title ? `/${value.title}` : `${value.title}`);\n// }, '') as string);\n// this._headerObjectMap[title] = {\n// id: title,\n// title,\n// field: cell_id,\n// headerType: this.rowHeaderTitle.headerType ?? 'text',\n// style: this.rowHeaderTitle.headerStyle,\n// define: <any>{\n// // id:\n// }\n// };\n// this._headerObjectMap[cell_id] = {\n// id: cell_id,\n// title: '',\n// field: cell_id,\n// headerType: this.cornerSetting.headerType ?? 'text',\n// style: this.cornerSetting.headerStyle,\n// define: <any>{\n// // id:\n// }\n// };\n// this._headerObjects.push(this._headerObjectMap[title]);\n// this._headerObjects.push(this._headerObjectMap[cell_id]);\n// this.rowShowAttrs.unshift(cell_id);\n// this.rowKeysPath.forEach((rowKey, index) => {\n// rowKey.unshift(title);\n// });\n// }\n// if (this.columnHeaderTitle) {\n// const cell_id = 'columnHeaderTitleCell';\n// const title =\n// typeof this.columnHeaderTitle.title === 'string'\n// ? this.columnHeaderTitle.title\n// : (this.columnsDefine.reduce((title: string, value) => {\n// if (typeof value === 'string') {\n// return title;\n// }\n// return title + (title ? `/${value.title}` : `${value.title}`);\n// }, '') as string);\n// this._headerObjectMap[title] = {\n// id: title,\n// title,\n// field: cell_id,\n// headerType: this.columnHeaderTitle.headerType ?? 'text',\n// style: this.columnHeaderTitle.headerStyle,\n// define: <any>{\n// // id:\n// }\n// };\n// this._headerObjectMap[cell_id] = {\n// id: cell_id,\n// title: '',\n// field: cell_id,\n// headerType: this.cornerSetting.headerType ?? 'text',\n// style: this.cornerSetting.headerStyle,\n// define: <any>{\n// // id:\n// }\n// };\n// this._headerObjects.push(this._headerObjectMap[title]);\n// this._headerObjects.push(this._headerObjectMap[cell_id]);\n// this.colShowAttrs.unshift(cell_id);\n// this.colKeysPath.forEach((columnKey, index) => {\n// columnKey.unshift(title);\n// });\n// }\n\n// if (this._table.isPivotChart()) {\n// this.hasTwoIndicatorAxes = this._indicatorObjects.some(indicatorObject => {\n// if (\n// indicatorObject.chartSpec &&\n// indicatorObject.chartSpec.series &&\n// indicatorObject.chartSpec.series.length > 1\n// ) {\n// return true;\n// }\n// return false;\n// });\n// this._chartItemSpanSize = 0;\n// this._chartItemBandSize = 0;\n// // this._chartPadding ;\n// this._indicatorObjects.find(indicatorObject => {\n// if ((indicatorObject?.style as TextStyle)?.padding) {\n// this._chartPadding = (indicatorObject.style as TextStyle).padding as number;\n// }\n// if (indicatorObject.chartSpec?.barWidth) {\n// this._chartItemSpanSize = indicatorObject.chartSpec?.barWidth;\n// }\n// const bandAxisConfig = indicatorObject.chartSpec?.axes?.find((axis: any) => {\n// return axis.type === 'band';\n// });\n// if (bandAxisConfig?.bandSize) {\n// this._chartItemBandSize = bandAxisConfig?.bandSize;\n// this._chartPaddingInner =\n// (isArray(bandAxisConfig.paddingInner) ? bandAxisConfig.paddingInner[0] : bandAxisConfig.paddingInner) ?? 0;\n// this._chartPaddingOuter =\n// (isArray(bandAxisConfig.paddingOuter) ? bandAxisConfig.paddingOuter[0] : bandAxisConfig.paddingOuter) ?? 0;\n// }\n// if (this._chartItemSpanSize > 0) {\n// return true;\n// }\n// indicatorObject.chartSpec.series?.find((seriesObject: any) => {\n// if (seriesObject.barWidth) {\n// this._chartItemSpanSize = seriesObject.barWidth;\n// }\n// if (this._chartItemSpanSize > 0) {\n// return true;\n// }\n// return false;\n// });\n// // if (this._chartItemSpanSize > 0) {\n// // return true;\n// // }\n// return false;\n// });\n\n// if (this.indicatorsAsCol) {\n// const cell_id = 'rowHeaderEmpty';\n// this._headerObjectMap[cell_id] = {\n// id: cell_id,\n// title: '',\n// field: cell_id,\n// headerType: this.cornerSetting.headerType ?? 'text',\n// style: this.cornerSetting.headerStyle,\n// define: <any>{\n// // id:\n// }\n// };\n// this._headerObjects.push(this._headerObjectMap[cell_id]);\n// this.rowShowAttrs.push(cell_id);\n\n// // deal with sub indicator axis\n\n// if (!this.hasTwoIndicatorAxes) {\n// this.colShowAttrs.pop();\n// }\n// } else {\n// const axisOption = ((this._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n// return axisOption.orient === 'left';\n// });\n// if (axisOption?.visible === false) {\n// this.rowShowAttrs.pop();\n// }\n// }\n// }\n\n// //#endregion\n// this._colCount =\n// (this.colKeysPath.length === 0 ? 1 : this.colKeysPath.length) *\n// (this.indicatorsAsCol ? this.indicatorKeys.length : 1) +\n// this.rowHeaderLevelCount +\n// this.rightFrozenColCount;\n// this._rowCount =\n// (this.rowKeysPath.length === 0 ? 1 : this.rowKeysPath.length) *\n// (!this.indicatorsAsCol ? this.indicatorKeys.length : 1) +\n// this.columnHeaderLevelCount +\n// this.bottomFrozenRowCount;\n// this.setColumnWidths();\n// }\n// private setColumnWidths() {\n// const returnWidths: WidthData[] = new Array(this.colCount).fill(undefined);\n// if (this.showRowHeader) {\n// if (this.rowHeaderTitle) {\n// returnWidths[0] = {};\n// }\n// this.rowShowAttrs.forEach((objKey, index) => {\n// const dimension = this.rowsDefine?.find(dimension =>\n// typeof dimension === 'string' ? false : dimension.dimensionKey === objKey\n// ) as IDimension;\n// dimension &&\n// (returnWidths[index + (this.rowHeaderTitle ? 1 : 0)] = {\n// width: dimension.width,\n// minWidth: dimension.minWidth,\n// maxWidth: dimension.maxWidth\n// });\n// });\n// }\n// if (this.indicatorsAsCol) {\n// for (let i = this.rowHeaderLevelCount; i < this.colCount; i++) {\n// const cellDefine = this.getBody(i, this.columnHeaderLevelCount);\n// returnWidths[i] = {\n// width: cellDefine?.width,\n// minWidth: cellDefine?.minWidth,\n// maxWidth: cellDefine?.maxWidth\n// };\n// }\n// } else {\n// let width: string | number = 0;\n// let maxWidth: string | number;\n// let minWidth: string | number;\n// let isAuto;\n// this._indicatorObjects.forEach((obj, index) => {\n// if (typeof obj.width === 'number') {\n// width = Math.max(obj.width, <number>width);\n// } else if (obj.width === 'auto') {\n// isAuto = true;\n// }\n// if (typeof obj.minWidth === 'number') {\n// minWidth = Math.max(obj.minWidth, <number>minWidth);\n// }\n// if (typeof obj.maxWidth === 'number') {\n// maxWidth = Math.max(obj.maxWidth, <number>maxWidth);\n// }\n// });\n// width = width > 0 ? width : isAuto ? 'auto' : undefined;\n// returnWidths.fill(\n// { width, minWidth, maxWidth },\n// this.rowHeaderLevelCount,\n// this.colCount - this.rightFrozenColCount\n// );\n// }\n// this._columnWidths = returnWidths;\n// }\n\n// private _addHeadersForTreeMode(\n// _headerCellIds: number[][] | string[][],\n// row: number,\n// header: IPivotLayoutHeadNode[],\n// roots: number[],\n// totalLevel: number,\n// show: boolean,\n// dimensions: (IDimension | string)[]\n// ): HeaderData[] {\n// function _newRow(row: number): number[] | string[] {\n// const newRow: number[] | string[] = (_headerCellIds[row] = []);\n// if (colIndex === 0) {\n// return newRow;\n// }\n// const prev = _headerCellIds[row - 1];\n// for (let col = 0; col < prev?.length; col++) {\n// newRow[col] = prev[col];\n// }\n// return newRow;\n// }\n// const results: HeaderData[] = [];\n// if (!_headerCellIds[row]) {\n// _newRow(row);\n// }\n// header.forEach(hd => {\n// const id = hd.id;\n// // const dimensionInfo: IDimension =\n// // (this.rowsDefine?.find(dimension =>\n// // typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey\n// // ) as IDimension) ??\n// // (this.columnsDefine?.find(dimension =>\n// // typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey\n// // ) as IDimension);\n// const dimensionInfo: IDimension = dimensions.find(dimension =>\n// typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey\n// ) as IDimension;\n\n// const cell: HeaderData = {\n// id,\n// title: hd.value,\n// field: hd.dimensionKey,\n// //如果不是整棵树的叶子节点,都靠左显示\n// style:\n// hd.level + 1 === totalLevel || typeof dimensionInfo?.headerStyle === 'function'\n// ? dimensionInfo?.headerStyle\n// : Object.assign({}, dimensionInfo?.headerStyle, { textAlign: 'left' }),\n// headerType: dimensionInfo?.headerType ?? 'text',\n// headerIcon: dimensionInfo?.headerIcon,\n// define: Object.assign(<any>hd, {\n// linkJump: (dimensionInfo as ILinkDimension)?.linkJump,\n// linkDetect: (dimensionInfo as ILinkDimension)?.linkDetect,\n// templateLink: (dimensionInfo as ILinkDimension)?.templateLink,\n\n// // image相关 to be fixed\n// keepAspectRatio: (dimensionInfo as IImageDimension)?.keepAspectRatio ?? false,\n// imageAutoSizing: (dimensionInfo as IImageDimension)?.imageAutoSizing,\n\n// headerCustomRender: dimensionInfo?.headerCustomRender,\n// headerCustomLayout: dimensionInfo?.headerCustomLayout,\n// dragHeader: dimensionInfo?.dragHeader\n// }), //这里不能新建对象,要用hd保持引用关系\n// fieldFormat: dimensionInfo?.headerFormat,\n// // iconPositionList:[]\n// dropDownMenu: dimensionInfo?.dropDownMenu,\n// pivotInfo: {\n// value: hd.value,\n// dimensionKey: hd.dimensionKey,\n// isPivotCorner: false\n// // customInfo: dimensionInfo?.customInfo\n// },\n// hierarchyLevel: hd.level,\n// dimensionTotalLevel: totalLevel,\n// hierarchyState: hd.level + 1 === totalLevel ? undefined : hd.hierarchyState,\n// width: dimensionInfo?.width,\n// minWidth: dimensionInfo?.minWidth,\n// maxWidth: dimensionInfo?.maxWidth,\n// parentCellId: roots[roots.length - 1]\n// };\n\n// results[id] = cell;\n// // this._cellIdDiemnsionMap.set(id, {\n// // dimensionKey: hd.dimensionKey,\n// // value: hd.value\n// // });\n// this._headerObjects[id] = cell;\n// _headerCellIds[row][colIndex] = id;\n// for (let r = row - 1; r >= 0; r--) {\n// _headerCellIds[r][colIndex] = roots[r];\n// }\n// if (hd.hierarchyState === HierarchyState.expand && (hd as IPivotLayoutHeadNode).children) {\n// //row传值 colIndex++和_addHeaders有区别\n// show && colIndex++;\n// this._addHeadersForTreeMode(\n// _headerCellIds,\n// row,\n// (hd as IPivotLayoutHeadNode).children ?? [],\n// [...roots, id],\n// totalLevel,\n// show && hd.hierarchyState === HierarchyState.expand, //当前节点show 且当前节点状态为展开 则传给子节点为show:true\n// dimensions\n// ).forEach(c => results.push(c));\n// } else {\n// // columns.push([\"\"])//代码一个路径\n// show && colIndex++;\n// for (let r = row + 1; r < _headerCellIds.length; r++) {\n// _headerCellIds[r][colIndex] = id;\n// }\n// }\n// });\n// return results;\n// }\n// get columnWidths(): WidthData[] {\n// return this._columnWidths;\n// }\n// getColumnWidthDefined(col: number): WidthData {\n// return this._columnWidths[col];\n// }\n// private getDimensionInfo(dimensionKey: string) {\n// const dimensionInfo: IDimension =\n// (this.rowsDefine?.find(dimension =>\n// typeof dimension === 'string' ? false : dimension.dimensionKey === dimensionKey\n// ) as IDimension) ??\n// (this.columnsDefine?.find(dimension =>\n// typeof dimension === 'string' ? false : dimension.dimensionKey === dimensionKey\n// ) as IDimension);\n// return dimensionInfo;\n// }\n\n// getIndicatorInfo(indicatorKey: string, indicatorValue = '') {\n// const indicatorInfo = this.indicatorsDefine?.find(indicator => {\n// if (typeof indicator === 'string') {\n// return false;\n// }\n// if (indicatorKey) {\n// return indicator.indicatorKey === indicatorKey;\n// }\n// if (indicatorValue) {\n// return indicator.title === indicatorValue;\n// }\n// return false;\n// }) as IIndicator;\n// return indicatorInfo;\n// }\n\n// getColKeysPath() {\n// return this.colKeysPath;\n// }\n// getRowKeysPath() {\n// return this.rowKeysPath;\n// }\n// /**\n// * 初始化_headerObjects\n// */\n// private initHeaderObjects() {\n// /**行表头headerObject */\n// // for (let i = 0, len = this.rowKeysPath.length; i <= len - 1; i++) {\n// // const rowKey = this.rowKeysPath[i];\n// // for (let j = 0, len2 = rowKey.length; j <= len2 - 1; j++) {\n// // if (!this._headerObjectMap[rowKey[j]]) {\n// // const ids = rowKey[j].split(this.dataset.stringJoinChar);\n// // const dimensionInfo = this.getDimensionInfo(this.rows[ids.length - 1]);\n// // this._headerObjectMap[rowKey[j]] = {\n// // id: rowKey[j],\n// // field: <string>dimensionInfo?.dimensionKey ?? this.rows[ids.length - 1],\n// // title: <string>ids[ids.length - 1],\n// // style: dimensionInfo?.headerStyle,\n// // define: {\n// // field: <string>dimensionInfo?.dimensionKey ?? this.rows[ids.length - 1],\n// // headerType: dimensionInfo?.headerType ?? 'text',\n// // cellType: 'text'\n// // }, //TODO 需要将define的用处 梳理清楚\n// // fieldFormat: dimensionInfo?.headerFormat,\n// // dropDownMenu: dimensionInfo?.dropDownMenu,\n// // headerType: dimensionInfo?.headerType ?? 'text',\n// // width: dimensionInfo?.width\n// // };\n// // this._headerObjects.push(this._headerObjectMap[rowKey[j]]);\n// // }\n// // }\n// // }\n// /**列表头headerObject */\n// for (let i = 0, len = this.colKeysPath.length; i <= len - 1; i++) {\n// const colKey = this.colKeysPath[i];\n// for (let j = 0, len2 = colKey.length; j <= len2 - 1; j++) {\n// if (!this._headerObjectMap[colKey[j]]) {\n// const ids = colKey[j].split(this.dataset.stringJoinChar);\n// const dimensionInfo = this.getDimensionInfo(this.columns[ids.length - 1]);\n// this._headerObjectMap[colKey[j]] = {\n// id: colKey[j],\n// field: <string>dimensionInfo?.dimensionKey ?? this.columns[ids.length - 1],\n// title: <string>ids[ids.length - 1],\n// style: dimensionInfo?.headerStyle,\n// define: {\n// field: <string>dimensionInfo?.dimensionKey ?? this.columns[ids.length - 1],\n// headerType: dimensionInfo?.headerType ?? 'text',\n// cellType: 'text'\n// },\n// fieldFormat: dimensionInfo?.headerFormat,\n// dropDownMenu: dimensionInfo?.dropDownMenu,\n// headerType: dimensionInfo?.headerType ?? 'text',\n// width: dimensionInfo?.width\n// };\n// this._headerObjects.push(this._headerObjectMap[colKey[j]]);\n// }\n// }\n// }\n// /**指标表头headerObject */\n// // const indicatorDimensionInfo = this.getIndicatorInfo(this.indicatorDimensionKey);\n// this.indicatorsDefine.forEach(indicator => {\n// const indicatorKey = typeof indicator === 'string' ? indicator : indicator.indicatorKey;\n// const indicatorInfo = typeof indicator === 'string' ? undefined : indicator;\n// if (!this._headerObjectMap[indicatorKey]) {\n// this._headerObjectMap[indicatorKey] = {\n// id: indicatorKey,\n// field: this.indicatorDimensionKey,\n// title: indicatorInfo?.title ?? indicatorKey,\n// style: indicatorInfo?.headerStyle, //?? indicatorDimensionInfo?.headerStyle,\n// define: {\n// field: this.indicatorDimensionKey,\n// headerType: indicatorInfo?.headerType ?? 'text',\n// cellType: 'text'\n// },\n// // fieldFormat: indicatorDimensionInfo?.headerFormat,\n// dropDownMenu: indicatorInfo?.dropDownMenu,\n// headerType: indicatorInfo?.headerType ?? 'text',\n// width: indicatorInfo?.width\n// };\n// this._headerObjects.push(this._headerObjectMap[indicatorKey]);\n// }\n// });\n// /**角表headerObject */\n// let cornerAttrs;\n// if (this.cornerSetting.titleOnDimension === 'column') {\n// cornerAttrs = this.colShowAttrs;\n// } else if (this.cornerSetting.titleOnDimension === 'row') {\n// cornerAttrs = this.rowShowAttrs;\n// }\n// cornerAttrs?.forEach(cornerAttrStr => {\n// if (!this._headerObjectMap[cornerAttrStr]) {\n// const dimensionInfo = this.getDimensionInfo(cornerAttrStr);\n// this._headerObjectMap[cornerAttrStr] = {\n// id: cornerAttrStr,\n// field: cornerAttrStr,\n// title:\n// cornerAttrStr === this.indicatorDimensionKey ? this.indicatorTitle : dimensionInfo?.title ?? cornerAttrStr,\n// style: this.cornerSetting?.headerStyle,\n// define: {\n// field: cornerAttrStr,\n// headerType: this.cornerSetting?.headerType ?? 'text',\n// cellType: 'text'\n// },\n// dropDownMenu: dimensionInfo?.dropDownMenu,\n// headerType: this.cornerSetting?.headerType ?? 'text',\n// width: dimensionInfo?.width\n// };\n// this._headerObjects.push(this._headerObjectMap[cornerAttrStr]);\n// }\n// });\n// }\n// /**\n// * 初始化_indicatorObjects\n// */\n// private initIndicatorObjects() {\n// // const indicatorDimensionInfo = this.dimensions?.find(\n// // (dimension) => dimension.dimensionKey === this.indicatorDimensionKey\n// // );\n// this.indicatorKeys.forEach(indicatorKey => {\n// const indicatorInfo = this.indicatorsDefine?.find(indicator => {\n// if (typeof indicator === 'string') {\n// return false;\n// }\n// return indicator.indicatorKey === indicatorKey;\n// }) as IIndicator;\n// this._indicatorObjects.push({\n// id: indicatorKey,\n// indicatorKey: indicatorKey,\n// field: indicatorKey,\n// define: Object.assign(\n// {\n// field: indicatorKey,\n// headerType: 'text',\n// cellType: indicatorInfo?.cellType ?? (indicatorInfo as any)?.columnType ?? 'text'\n// },\n// indicatorInfo as any\n// ),\n// fieldFormat: indicatorInfo?.format,\n// cellType: indicatorInfo?.cellType ?? (indicatorInfo as any)?.columnType ?? 'text',\n// chartModule: indicatorInfo && ('chartModule' in indicatorInfo ? indicatorInfo?.chartModule : null),\n// chartSpec: indicatorInfo && ('chartSpec' in indicatorInfo ? indicatorInfo?.chartSpec : null),\n// sparklineSpec: indicatorInfo && ('sparklineSpec' in indicatorInfo ? indicatorInfo?.sparklineSpec : null),\n// style: indicatorInfo?.style,\n// icon: indicatorInfo?.icon,\n// width: indicatorInfo?.width,\n// minWidth: indicatorInfo?.minWidth,\n// maxWidth: indicatorInfo?.maxWidth,\n// disableColumnResize: indicatorInfo?.disableColumnResize\n// });\n// });\n// }\n// get showColumnHeader(): boolean {\n// return this._showColumnHeader;\n// }\n// set showColumnHeader(_showColumnHeader: boolean) {\n// this._showColumnHeader = _showColumnHeader;\n// }\n// get showRowHeader(): boolean {\n// return this._showRowHeader;\n// }\n// set showRowHeader(_showRowHeader: boolean) {\n// this._showRowHeader = _showRowHeader;\n// }\n// get columnHeaderTitle(): ITitleDefine {\n// return this._columnHeaderTitle;\n// }\n// set columnHeaderTitle(_columnHeaderTitle: ITitleDefine) {\n// this._columnHeaderTitle = _columnHeaderTitle;\n// }\n// get rowHeaderTitle(): ITitleDefine {\n// return this._rowHeaderTitle;\n// }\n// set rowHeaderTitle(_rowHeaderTitle: ITitleDefine) {\n// this._rowHeaderTitle = _rowHeaderTitle;\n// }\n// getCellLocation(col: number, row: number): CellLocation {\n// if (this.isCornerHeader(col, row)) {\n// return 'cornerHeader';\n// } else if (this.isColumnHeader(col, row)) {\n// return 'columnHeader';\n// } else if (this.isRowHeader(col, row)) {\n// return 'rowHeader';\n// }\n// return 'body';\n// }\n\n// isHeader(col: number, row: number): boolean {\n// if (col < this.rowHeaderLevelCount) {\n// return true;\n// }\n// if (row < this.columnHeaderLevelCount) {\n// return true;\n// }\n// if (col >= this.colCount - this.rightFrozenColCount) {\n// return true;\n// }\n// if (row >= this.rowCount - this.bottomFrozenRowCount) {\n// return true;\n// }\n// return false;\n// }\n// isCornerHeader(col: number, row: number): boolean {\n// if (col < this.rowHeaderLevelCount && row < this.columnHeaderLevelCount) {\n// return true;\n// }\n// return false;\n// }\n// isColumnHeader(col: number, row: number): boolean {\n// if (col >= this.rowHeaderLevelCount && row < this.columnHeaderLevelCount) {\n// return true;\n// }\n// return false;\n// }\n// isRightFrozenColumn(col: number, row: number): boolean {\n// if (\n// col >= this.colCount - this.rightFrozenColCount &&\n// row >= this.columnHeaderLevelCount &&\n// row < this.rowCount - this.bottomFrozenRowCount\n// ) {\n// return true;\n// }\n// return false;\n// }\n// isBottomFrozenRow(col: number, row: number): boolean {\n// if (\n// col >= this.rowHeaderLevelCount &&\n// row >= this.rowCount - this.bottomFrozenRowCount &&\n// col < this.colCount - this.rightFrozenColCount\n// ) {\n// return true;\n// }\n// return false;\n// }\n// isLeftBottomCorner(col: number, row: number): boolean {\n// if (col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount) {\n// return true;\n// }\n// return false;\n// }\n// isRightTopCorner(col: number, row: number): boolean {\n// if (col >= this.colCount - this.rightFrozenColCount && row < this.columnHeaderLevelCount) {\n// return true;\n// }\n// return false;\n// }\n// isRightBottomCorner(col: number, row: number): boolean {\n// if (col >= this.colCount - this.rightFrozenColCount && row >= this.rowCount - this.bottomFrozenRowCount) {\n// return true;\n// }\n// return false;\n// }\n// /**\n// * 是否为行表头,不包含角头\n// * @param col\n// * @param row\n// * @returns\n// */\n// isRowHeader(col: number, row: number): boolean {\n// if (col < this.rowHeaderLevelCount && row >= this.columnHeaderLevelCount) {\n// return true;\n// }\n// return false;\n// }\n// /**\n// * 判读是否为指标名称单元格。非角头部分,行表头或者列表头显示的指标名\n// * @param col\n// * @param row\n// * @returns\n// */\n// isColumnIndicatorHeader(col: number, row: number): boolean {\n// if (\n// this._indicatorShowType === 'column' &&\n// row === this.columnHeaderLevelCount - 1 &&\n// col >= this.rowHeaderLevelCount\n// ) {\n// return true;\n// }\n// return false;\n// }\n// /**\n// * 判读是否为指标名称单元格。非角头部分,行表头或者列表头显示的指标名\n// * @param col\n// * @param row\n// * @returns\n// */\n// isRowIndicatorHeader(col: number, row: number): boolean {\n// if (\n// this._indicatorShowType === 'row' &&\n// col === this.rowHeaderLevelCount - 1 &&\n// row >= this.columnHeaderLevelCount\n// ) {\n// return true;\n// }\n// return false;\n// }\n// /**\n// * 判读是否为指标名称单元格。非角头部分,行表头或者列表头显示的指标名\n// * @param col\n// * @param row\n// * @returns\n// */\n// isIndicatorHeader(col: number, row: number): boolean {\n// return this.isColumnIndicatorHeader(col, row) || this.isRowIndicatorHeader(col, row);\n// }\n\n// getColumnHeaderRange(): CellRange {\n// return {\n// start: { col: this.rowHeaderLevelCount, row: 0 },\n// end: { col: this.colCount - 1, row: this.columnHeaderLevelCount - 1 }\n// };\n// }\n// getRowHeaderRange(): CellRange {\n// return {\n// start: { col: 0, row: this.columnHeaderLevelCount },\n// end: { col: this.rowHeaderLevelCount - 1, row: this.rowCount - 1 }\n// };\n// }\n// getCornerHeaderRange(): CellRange {\n// return {\n// start: { col: 0, row: 0 },\n// end: { col: this.rowHeaderLevelCount - 1, row: this.columnHeaderLevelCount - 1 }\n// };\n// }\n// getBodyRange(): CellRange {\n// return {\n// start: { col: this.rowHeaderLevelCount, row: this.columnHeaderLevelCount },\n// end: { col: this.colCount - 1, row: this.rowCount - 1 }\n// };\n// }\n// resetCellIds() {\n// // for (let row = 0; row < this.columnHeaderLevelCount; row++) {}\n// }\n// get headerLevelCount(): number {\n// return this.columnHeaderLevelCount;\n// }\n// get columnHeaderLevelCount(): number {\n// const colLevelCount = this.colShowAttrs.length;\n// if (this.showColumnHeader) {\n// const count = !this.indicatorsAsCol\n// ? colLevelCount\n// : this.hideIndicatorName //设置隐藏表头,且表头最下面一级就是指标维度 则-1\n// ? this.colShowAttrs[this.colShowAttrs.length - 1] === this.indicatorDimensionKey\n// ? colLevelCount - 1\n// : colLevelCount\n// : colLevelCount;\n\n// // if (this.indicatorsAsCol && this._table.isPivotChart()) {\n// // // 指标在列上,指标及其对应坐标轴显示在底部,下侧冻结行数为1;\n// // // 如果指标对应两个轴,则第二个轴显示在上部,columnHeaderLevelCount不变,否则columnHeader不显示指标,columnHeaderLevelCount - 1\n// // // count -= 1;\n// // } else if (this._table.isPivotChart()) {\n// // // 指标在行上,维度对应坐标轴显示在底部,下侧冻结行数为1,上侧不变\n// // }\n\n// return count;\n// }\n// return !this.indicatorsAsCol ? 0 : this.hideIndicatorName ? 0 : 1;\n// }\n// get rowHeaderLevelCount(): number {\n// const rowLevelCount = this.rowShowAttrs.length;\n// if (this.showRowHeader) {\n// if (this.rowHierarchyType === 'tree') {\n// if (this.rowHeaderTitle) {\n// return 2;\n// }\n// return 1;\n// }\n// const count = this.indicatorsAsCol\n// ? rowLevelCount\n// : this.hideIndicatorName //设置隐藏表头,且表头最下面一级就是指标维度 则-1\n// ? this.rowShowAttrs[this.rowShowAttrs.length - 1] === this.indicatorDimensionKey\n// ? rowLevelCount - 1\n// : rowLevelCount\n// : rowLevelCount;\n\n// // if (this.indicatorsAsCol && this._table.isPivotChart()) {\n// // // 指标在列上,维度对应坐标轴显示在左侧,rowHeaderLevelCount + 1;\n// // count += 1;\n// // } else if (this._table.isPivotChart()) {\n// // // 指标在行上,指标对应坐标轴显示在左侧指标单元格,rowHeaderLevelCount不变\n// // }\n\n// return count;\n// }\n// return this.indicatorsAsCol ? 0 : this.hideIndicatorName ? 0 : 1;\n// }\n// get colCount(): number {\n// return this._colCount;\n// }\n// get rowCount(): number {\n// return this._rowCount;\n// }\n// get bodyRowCount() {\n// return this._bodyRowCount;\n// }\n// get bottomFrozenRowCount(): number {\n// if (!this._table.isPivotChart()) {\n// return 0;\n// }\n// const axisOption = ((this._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n// return axisOption.orient === 'bottom';\n// });\n// if (axisOption?.visible === false) {\n// return 0;\n// }\n// if (this.indicatorsAsCol) {\n// // 指标在列上,指标及其对应坐标轴显示在底部,下侧冻结行数为1\n// return 1;\n// }\n// return 1; // 指标在行上,维度对应坐标轴显示在底部,下侧冻结行数为1\n// }\n// get rightFrozenColCount(): number {\n// if (!this._table.isPivotChart()) {\n// return 0;\n// }\n// const axisOption = ((this._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n// return axisOption.orient === 'right';\n// });\n// if (axisOption?.visible === false) {\n// return 0;\n// }\n\n// if (this.indicatorsAsCol) {\n// return 0; // 指标在列上,没有图表需要显示右轴\n// } else if (this.hasTwoIndicatorAxes) {\n// // 查找指标,判断是否有双轴情况,如果有,则右侧冻结列数为1\n// return 1;\n// }\n// return 0;\n// }\n// get leftAxesCount(): number {\n// if (!this._table.isPivotChart()) {\n// return 0;\n// }\n// const axisOption = ((this._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n// return axisOption.orient === 'left';\n// });\n// if (axisOption?.visible === false) {\n// return 0;\n// }\n// if (this.indicatorsAsCol) {\n// return 1; // 左侧维度轴\n// }\n// return 1; // 左侧主指标轴\n// }\n// get topAxesCount(): number {\n// if (!this._table.isPivotChart()) {\n// return 0;\n// }\n// const axisOption = ((this._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n// return axisOption.orient === 'top';\n// });\n// if (axisOption?.visible === false) {\n// return 0;\n// }\n// if (this.indicatorsAsCol && this.hasTwoIndicatorAxes) {\n// return 1; // 顶部副指标\n// }\n// return 0; // 顶部无轴\n// }\n// get rightAxesCount(): number {\n// return this.rightFrozenColCount;\n// }\n// get bottomAxesCount(): number {\n// return this.bottomFrozenRowCount;\n// }\n\n// get headerObjects(): HeaderData[] {\n// return this._headerObjects;\n// }\n// get columnObjects(): IndicatorData[] {\n// return this._indicatorObjects;\n// }\n// /**\n// * 其他layout文件这个函数返回的是id值,这里其实是返回的维度成员名\n// * @param col\n// * @param row\n// * @returns\n// */\n// getCellId(col: number, row: number): LayoutObjectId {\n// if (\n// (col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount) ||\n// (row < this.columnHeaderLevelCount && col >= this.colCount - this.rightFrozenColCount)\n// ) {\n// return 0;\n// }\n// if (row >= 0 && col >= 0) {\n// if (this.isCornerHeader(col, row)) {\n// if (this.cornerSetting.titleOnDimension === 'column') {\n// return this.colShowAttrs[row];\n// } else if (this.cornerSetting.titleOnDimension === 'row') {\n// return this.rowShowAttrs[col];\n// }\n// } else if (this.isColumnHeader(col, row)) {\n// if (row < this.columns.length + (this.columnHeaderTitle ? 1 : 0)) {\n// return (\n// this.convertColKeys[row]?.[\n// this.indicatorsAsCol\n// ? Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length)\n// : col - this.rowHeaderLevelCount\n// ] ?? `colHeaderAxis-${col}-${row}`\n// );\n// }\n// return this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length];\n// } else if (this.isRowHeader(col, row)) {\n// if (col < this.rows.length + (this.rowHeaderTitle ? 1 : 0)) {\n// return (\n// this.rowKeysPath[\n// !this.indicatorsAsCol\n// ? Math.floor((row - this.columnHeaderLevelCount) / this.indicatorKeys.length)\n// : row - this.columnHeaderLevelCount\n// ]?.[col] ?? `rowHeaderAxis-${col}-${row}`\n// );\n// }\n// if (this.indicatorsAsCol && col === this.rowHeaderLevelCount - 1) {\n// return `rowHeaderAxis-${col}-${row}`;\n// }\n// return this.indicatorKeys[(row - this.columnHeaderLevelCount) % this.indicatorKeys.length];\n// } else if (this.isRightFrozenColumn(col, row)) {\n// if (!this.indicatorsAsCol) {\n// return this.indicatorKeys[(row - this.columnHeaderLevelCount) % this.indicatorKeys.length];\n// }\n// return this.rowKeysPath[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1];\n// } else if (this.isBottomFrozenRow(col, row)) {\n// if (this.indicatorsAsCol) {\n// return this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length];\n// }\n// return this.convertColKeys[this.convertColKeys.length - 1]?.[\n// Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length)\n// ];\n// }\n// }\n// return 0;\n// }\n// /**\n// * 获取单元格所代表的指标名称\n// * @param col\n// * @param row\n// * @returns\n// */\n// getIndicatorKey(col: number, row: number) {\n// if (this.isHeader(col, row)) {\n// return '';\n// }\n// if (this.indicatorsAsCol) {\n// const bodyCol = col - this.rowHeaderLevelCount;\n// return this.indicatorKeys[bodyCol % this.indicatorKeys.length];\n// }\n// const bodyRow = row - this.columnHeaderLevelCount;\n// return this.indicatorKeys[bodyRow % this.indicatorKeys.length];\n// }\n// getHeader(col: number, row: number): HeaderData {\n// let id = this.getCellId(col, row) as string;\n// if (id?.toString().startsWith('rowHeaderAxis')) {\n// id = 'rowHeaderEmpty';\n// // } else if (id.toString().startsWith('colHeaderAxis')) {\n// }\n// return this._headerObjectMap[id as number | string]! ?? EMPTY_HEADER;\n// }\n// getHeaderField(col: number, row: number) {\n// const id = this.getCellId(col, row);\n// return this._headerObjectMap[id as number]?.field || this.getBody(col, row)?.field;\n// }\n// getHeaderFieldKey(col: number, row: number): undefined {\n// return undefined;\n// }\n// getHeaderCellAdressById(id: number): CellAddress | undefined {\n// return undefined;\n// }\n// getHeaderCellAddressByField(field: string): CellAddress | undefined {\n// throw new Error(`Method not implemented.${field}`);\n// }\n// // getBody(_col: number, _row: number): IndicatorData {\n// // // const dimensionInfo = this.dimensions?.find((dimension: IDimension) => {\n// // // return dimension.indicators?.length! > 0;\n// // // });\n// // // if (this.indicatorsAsCol)\n// // // return this.indicators[\n// // // (_col - this.rowHeaderLevelCount) % (dimensionInfo?.indicators?.length ?? 0)\n// // // ];\n// // // return this.indicators[\n// // // (_row - this.columnHeaderLevelCount) % (dimensionInfo?.indicators?.length ?? 0)\n// // // ];\n// // // const dimensionInfo = this.dimensions?.[this.indicatorDimensionKey];\n// // let indicatorInfo;\n// // if (this.indicatorsAsCol) {\n// // indicatorInfo = this.getIndicatorInfo(\n// // this?.indicators?.[(_col - this.rowHeaderLevelCount) % (this.indicators?.length ?? 0)]\n// // );\n// // } else {\n// // indicatorInfo = this.getIndicatorInfo(\n// // this?.indicators?.[(_row - this.columnHeaderLevelCount) % (this.indicators?.length ?? 0)]\n// // );\n// // }\n// // return {\n// // id: 0,\n// // indicatorKey: this.indicators[(_col - this.rowHeaderLevelCount) % (this.indicators?.length ?? 0)],\n// // field: this.indicators[(_col - this.rowHeaderLevelCount) % (this.indicators?.length ?? 0)],\n// // cellType: indicatorInfo?.cellType ?? 'text',\n// // style: indicatorInfo?.style,\n// // define: {\n// // field: this.indicators[(_col - this.rowHeaderLevelCount) % (this.indicators?.length ?? 0)],\n// // headerType: 'text',\n// // cellType: indicatorInfo?.cellType ?? 'text'\n// // }\n// // };\n// // }\n// getBody(_col: number, _row: number): IndicatorData {\n// // let indicatorData;\n// //正常情况下 通过行号或者列号可以取到Indicator的配置信息 但如果指标在前维度在后的情况下(如风神:列配置【指标名称,地区】) indicators中的数量是和真正指标值一样数量\n// // if (this.indicatorsAsCol) indicatorData = this.indicators[_col - this.rowHeaderLevelCount];\n// // else indicatorData = this.indicators[_row - this.columnHeaderLevelCount];\n// // if (indicatorData) return indicatorData;\n// const paths = this.getCellHeaderPaths(_col, _row);\n// if (this.indicatorsAsCol) {\n// const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n// return (\n// this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey) ??\n// this._indicatorObjects[0] ?? {\n// id: '',\n// field: undefined,\n// indicatorKey: undefined,\n// cellType: undefined,\n// define: undefined\n// }\n// );\n// }\n// const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n// return (\n// this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey) ??\n// this._indicatorObjects[0] ?? {\n// id: '',\n// field: undefined,\n// indicatorKey: undefined,\n// cellType: undefined,\n// define: undefined\n// }\n// );\n// }\n// // getBodyLayoutRangeById(id: LayoutObjectId): CellRange {\n// // for (let col = 0; col < (this.colCount ?? 0); col++) {\n// // if (id === this.columnObjects[col].id) {\n// // return {\n// // start: { col, row: 0 },\n// // end: { col, row: 0 }\n// // };\n// // }\n// // }\n\n// // throw new Error(`can not found body layout @id=${id as number}`);\n// // }\n// /**\n// * 这个结果直接影响合并单元格\n// * 目前body部分 都按不合并\n// * 指标名称isIndicator 不合并\n// * 列表头部分,合并情况只考虑横向合并\n// * 行表头部分,合并情况只考虑纵向合并\n// * @param col\n// * @param row\n// * @returns\n// */\n// getCellRange(col: number, row: number): CellRange {\n// const result: CellRange = { start: { col, row }, end: { col, row } };\n// if (!this.isHeader(col, row) || col === -1 || row === -1 || this.isIndicatorHeader(col, row)) {\n// return result;\n// }\n\n// if (this.isRightFrozenColumn(col, row) || this.isBottomFrozenRow(col, row)) {\n// return result;\n// }\n\n// //in header\n// const id = this.getCellId(col, row);\n// for (let c = col - 1; c >= 0; c--) {\n// if (id !== this.getCellId(c, row)) {\n// break;\n// }\n// result.start.col = c;\n// }\n// for (let c = col + 1; c < (this.colCount ?? 0); c++) {\n// if (id !== this.getCellId(c, row)) {\n// break;\n// }\n// result.end.col = c;\n// }\n// for (let r = row - 1; r >= 0; r--) {\n// if (id !== this.getCellId(col, r)) {\n// break;\n// }\n// result.start.row = r;\n// }\n// for (let r = row + 1; r < (this.rowCount ?? 0); r++) {\n// if (id !== this.getCellId(col, r)) {\n// break;\n// }\n// result.end.row = r;\n// }\n// return result;\n// }\n// isCellRangeEqual(col: number, row: number, targetCol: number, targetRow: number): boolean {\n// const range1 = this.getCellRange(col, row);\n// const range2 = this.getCellRange(targetCol, targetRow);\n// return (\n// range1.start.col === range2.start.col &&\n// range1.end.col === range2.end.col &&\n// range1.start.row === range2.start.row &&\n// range1.end.row === range2.end.row\n// );\n// }\n// /**\n// * 根据行号,得出body部分也就是数据部分 是第几条\n// * @param row\n// * @returns\n// */\n// getRecordIndexByCell(row: number): number {\n// if (row < this.columnHeaderLevelCount) {\n// return -1;\n// }\n// return this.indicatorsAsCol\n// ? row - this.columnHeaderLevelCount\n// : Math.floor((row - this.columnHeaderLevelCount) / this.indicatorKeys.length);\n// }\n// /**\n// * 根据列号,得出body部分也就是数据部分 是第几条\n// * @param col\n// * @returns\n// */\n// getRecordIndexByCol(col: number): number {\n// if (col < this.rowHeaderLevelCount) {\n// return -1;\n// }\n// // return col - this.rowHeaderLevelCount;\n// return !this.indicatorsAsCol\n// ? col - this.rowHeaderLevelCount\n// : Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length);\n// }\n// getRecordStartRowByRecordIndex(index: number): number {\n// return this.columnHeaderLevelCount + index;\n// }\n\n// // getCellRangeTranspose(): CellRange {\n// // return { start: { col: 0, row: 0 }, end: { col: 0, row: 0 } };\n// // }\n// /**\n// * 计算一个单元格 行列维度信息\n// * @param col\n// * @param row\n// * @returns\n// */\n// getCellHeaderPaths(col: number, row: number): IPivotTableCellHeaderPaths {\n// const recordCol = this.getRecordIndexByCol(col);\n// const recordRow = this.getRecordIndexByCell(row);\n// let colPath;\n// let rowPath;\n// let colHeaderPaths: string[];\n// let rowHeaderPaths: string[];\n// if (recordCol >= 0) {\n// colPath = this.colKeysPath[recordCol];\n// colHeaderPaths = colPath?.[colPath.length - 1]?.split(this.dataset.stringJoinChar);\n// if (colHeaderPaths && this.showColumnHeader && row < this.columns.length - 1) {\n// colHeaderPaths = colHeaderPaths.slice(0, row + 1);\n// } else if (!colHeaderPaths) {\n// colHeaderPaths = [];\n// }\n// }\n// if (recordRow >= 0) {\n// rowPath = this.rowKeysPath[recordRow];\n// rowHeaderPaths = rowPath?.[rowPath.length - 1]?.split(this.dataset.stringJoinChar);\n// if (rowHeaderPaths && this.showRowHeader && col < this.rows.length - 1) {\n// rowHeaderPaths = rowHeaderPaths.slice(0, col + 1);\n// } else if (!rowHeaderPaths) {\n// rowHeaderPaths = [];\n// }\n// }\n// if (colHeaderPaths && this.indicatorsAsCol && col >= this.rowHeaderLevelCount) {\n// colHeaderPaths.push(this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length]);\n// } else if (rowHeaderPaths && row >= this.columnHeaderLevelCount) {\n// rowHeaderPaths.push(this.indicatorKeys[(row - this.columnHeaderLevelCount) % this.indicatorKeys.length]);\n// }\n// return {\n// colHeaderPaths:\n// colHeaderPaths?.map((key: string, index: number) => {\n// const indicatorObject = this._indicatorObjects.find(indicator => indicator.indicatorKey === key);\n// return {\n// dimensionKey: !indicatorObject ? this.colShowAttrs[index] : undefined,\n// indicatorKey: indicatorObject ? key : undefined,\n// value: !indicatorObject ? key : (indicatorObject.define.title as string)\n// };\n// }) ?? [],\n// rowHeaderPaths:\n// rowHeaderPaths?.map((key: string, index: number) => {\n// const indicatorObject = this._indicatorObjects.find(indicator => indicator.indicatorKey === key);\n// return {\n// dimensionKey: !indicatorObject ? this.rowShowAttrs[index] : undefined,\n// indicatorKey: indicatorObject ? key : undefined,\n// value: !indicatorObject ? key : (indicatorObject.define.title as string)\n// };\n// }) ?? []\n// };\n// }\n// /**\n// * 通过dimensionPath获取到对应的表头地址col row, dimensionPath不要求必须按照表头层级顺序传递\n// * @param dimensions\n// * @returns\n// */\n// getCellAdressByHeaderPath(\n// dimensionPaths:\n// | {\n// colHeaderPaths: IDimensionInfo[];\n// rowHeaderPaths: IDimensionInfo[];\n// }\n// | IDimensionInfo[]\n// ): CellAddress | undefined {\n// let colHeaderPaths;\n// let rowHeaderPaths;\n// if (Array.isArray(dimensionPaths)) {\n// if (dimensionPaths.length > this.rowShowAttrs.length + this.colShowAttrs.length) {\n// //如果传入的path长度比行列维度层级多的话 无法匹配\n// return undefined;\n// }\n// // 如果传入的是整体的path 按照行列维度区分开\n// colHeaderPaths = dimensionPaths.filter(\n// (path: IDimensionInfo) => this.colShowAttrs.indexOf(path.dimensionKey) >= 0\n// );\n// rowHeaderPaths = dimensionPaths.filter(\n// (path: IDimensionInfo) => this.rowShowAttrs.indexOf(path.dimensionKey) >= 0\n// );\n// } else {\n// colHeaderPaths = dimensionPaths.colHeaderPaths;\n// rowHeaderPaths = dimensionPaths.rowHeaderPaths;\n// }\n\n// if (!Array.isArray(colHeaderPaths) && !Array.isArray(rowHeaderPaths)) {\n// return undefined;\n// }\n// // 行列维度path根据key排序\n// colHeaderPaths?.sort((a, b) => {\n// return (\n// this.colShowAttrs.indexOf(a.dimensionKey ?? this.indicatorDimensionKey) -\n// this.colShowAttrs.indexOf(b.dimensionKey ?? this.indicatorDimensionKey)\n// );\n// });\n// rowHeaderPaths?.sort((a, b) => {\n// return (\n// this.rowShowAttrs.indexOf(a.dimensionKey ?? this.indicatorDimensionKey) -\n// this.rowShowAttrs.indexOf(b.dimensionKey ?? this.indicatorDimensionKey)\n// );\n// });\n// let needLowestLevel = false; // needLowestLevel来标记是否需要 提供到最底层的维度层级信息\n// // 如果行列维度都有值 说明是匹配body单元格 那这个时候 维度层级应该是满的\n// if (colHeaderPaths?.length >= 1 && rowHeaderPaths?.length >= 1) {\n// needLowestLevel = true;\n// }\n// //这里相当于默认了行列号为0\n// let col = 0;\n// let row = 0;\n// let defaultCol;\n// let defaultRow;\n// let rowTree = this.rowTree;\n// let columnTree = this.columnTree;\n// let toFindIndicator;\n// // 按照colHeaderPaths维度层级寻找到底层维度值节点\n// if (colHeaderPaths) {\n// for (let i = 0; i < colHeaderPaths.length; i++) {\n// const colDimension = colHeaderPaths[i];\n// if (colDimension.indicatorKey) {\n// toFindIndicator = colDimension.indicatorKey;\n// break;\n// }\n// for (let j = 0; j < columnTree.length; j++) {\n// const dimension = columnTree[j];\n// if (\n// !isValid(colDimension.indicatorKey) &&\n// dimension.dimensionKey === colDimension.dimensionKey &&\n// dimension.value === colDimension.value\n// ) {\n// columnTree = dimension.children;\n// if (!columnTree || columnTree.length === 0 || columnTree?.[0]?.indicatorKey) {\n// col += j;\n// }\n// break;\n// }\n// col += dimension.children?.[0]?.indicatorKey ? 0 : dimension.children?.length ?? 0;\n// }\n// }\n// }\n// // 按照rowHeaderPaths维度层级寻找到底层维度值节点\n// if (rowHeaderPaths) {\n// for (let i = 0; i < rowHeaderPaths.length; i++) {\n// const rowDimension = rowHeaderPaths[i];\n// if (rowDimension.indicatorKey) {\n// toFindIndicator = rowDimension.indicatorKey;\n// break;\n// }\n// // 判断级别,找到distDimension\n// // let isCol = false;\n// for (let j = 0; j < rowTree.length; j++) {\n// const dimension = rowTree[j];\n// if (\n// !isValid(rowDimension.indicatorKey) &&\n// dimension.dimensionKey === rowDimension.dimensionKey &&\n// dimension.value === rowDimension.value\n// ) {\n// rowTree = dimension.children;\n// if (!rowTree || rowTree.length === 0 || rowTree?.[0]?.indicatorKey) {\n// row += j;\n// }\n// break;\n// }\n// row += dimension.children?.[0]?.indicatorKey ? 0 : dimension.children?.length ?? 0;\n// }\n// }\n// }\n// col =\n// (this.indicatorsAsCol ? col * this.indicatorKeys.length + this.indicatorKeys.indexOf(toFindIndicator) : col) +\n// this.rowHeaderLevelCount;\n\n// row =\n// (!this.indicatorsAsCol ? row * this.indicatorKeys.length + this.indicatorKeys.indexOf(toFindIndicator) : row) +\n// this.columnHeaderLevelCount;\n// if (isValid(col) || isValid(row)) {\n// return { col: col ?? defaultCol, row: row ?? defaultRow };\n// }\n// return undefined;\n// }\n// getHeaderDimension(col: number, row: number): IDimension | undefined {\n// if (this.isHeader(col, row)) {\n// const header = this.getHeader(col, row);\n// const dimension =\n// this.rowsDefine?.find(dimension => typeof dimension !== 'string' && dimension.dimensionKey === header.field) ??\n// this.columnsDefine?.find(dimension => typeof dimension !== 'string' && dimension.dimensionKey === header.field);\n// return dimension as IDimension;\n// }\n// return undefined;\n// }\n// updateDataset(dataset: Dataset) {\n// this.dataset = dataset;\n// this.dataConfig = dataset.dataConfig;\n// this.rowKeysPath = dataset.rowKeysPath;\n// this.colKeysPath = dataset.colKeysPath;\n// this.tree = dataset.tree;\n// this._indicatorObjects = [];\n// this._headerObjects = [];\n// this._headerObjectMap = {};\n// this.initState();\n// this.convertColKeys = transpose(this.colKeysPath);\n// }\n\n// // 为列宽计算专用,兼容列表 对齐pivot-header-layout文件\n// isHeaderForColWidth(col: number, row: number): boolean {\n// return this.isHeader(col, row);\n// }\n// getHeaderForColWidth(col: number, row: number): HeaderData {\n// return this.getHeader(col, row);\n// }\n\n// // TODO: 补充Header Move\n\n// setChartInstance(_col: number, _row: number, chartInstance: any) {\n// const paths = this.getCellHeaderPaths(_col, _row);\n// let indicatorObj;\n// if (this.indicatorsAsCol) {\n// const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n// indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// } else {\n// const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n// indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// }\n// indicatorObj && (indicatorObj.chartInstance = chartInstance);\n// }\n\n// getChartInstance(_col: number, _row: number) {\n// const paths = this.getCellHeaderPaths(_col, _row);\n// let indicatorObj;\n// if (this.indicatorsAsCol) {\n// const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n// indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// } else {\n// const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n// indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// }\n// return indicatorObj?.chartInstance;\n// }\n\n// //#region pivot chart 区别于 pivot table 的特有方法\n// /** 将_selectedDataItemsInChart保存的数据状态同步到各个图表实例中 */\n// _generateChartState() {\n// const state = {\n// vtable_selected: {\n// filter: (datum: any) => {\n// if ((this._table as PivotChart)._selectedDataItemsInChart.length >= 1) {\n// const match = (this._table as PivotChart)._selectedDataItemsInChart.find(item => {\n// for (const itemKey in item) {\n// if (item[itemKey] !== datum[itemKey]) {\n// return false;\n// }\n// }\n// return true;\n// });\n// return !!match;\n// } else if ((this._table as PivotChart)._selectedDimensionInChart?.length) {\n// // 判断维度点击\n// const match = (this._table as PivotChart)._selectedDimensionInChart.every(item => {\n// if (datum[item.key] !== item.value) {\n// return false;\n// }\n// return true;\n// });\n// return !!match;\n// }\n// return false;\n// }\n// },\n// vtable_selected_reverse: {\n// filter: (datum: any) => {\n// if ((this._table as PivotChart)._selectedDataItemsInChart.length >= 1) {\n// const match = (this._table as PivotChart)._selectedDataItemsInChart.find(item => {\n// for (const itemKey in item) {\n// if (item[itemKey] !== datum[itemKey]) {\n// return false;\n// }\n// }\n// return true;\n// });\n// return !match;\n// } else if ((this._table as PivotChart)._selectedDimensionInChart?.length) {\n// // 判断维度点击\n// const match = (this._table as PivotChart)._selectedDimensionInChart.every(item => {\n// if (datum[item.key] !== item.value) {\n// return false;\n// }\n// return true;\n// });\n// return !match;\n// }\n// return false;\n// }\n// }\n// };\n// return state;\n// }\n// updateDataStateToChartInstance(activeChartInstance?: any): void {\n// if (!activeChartInstance) {\n// activeChartInstance = (this._table as PivotChart)._getActiveChartInstance();\n// }\n// const state = this._generateChartState();\n// this._indicatorObjects.forEach((_indicatorObject: IndicatorData) => {\n// const chartInstance = _indicatorObject.chartInstance;\n// chartInstance.updateState(state);\n// });\n// activeChartInstance?.updateState(state);\n// }\n// updateDataStateToActiveChartInstance(activeChartInstance?: any): void {\n// if (!activeChartInstance) {\n// activeChartInstance = (this._table as PivotChart)._getActiveChartInstance();\n// }\n// const state = this._generateChartState();\n// activeChartInstance?.updateState(state);\n// }\n// /** 获取某一图表列的最优宽度,计算逻辑是根据图表的xField的维度值个数 * barWidth */\n// getOptimunWidthForChart(col: number) {\n// const path = this.getCellHeaderPaths(col, this.columnHeaderLevelCount).colHeaderPaths;\n// let collectedValues: any;\n// for (const key in this.dataset.collectValuesBy) {\n// if (this.dataset.collectValuesBy[key].type === 'xField' && !this.dataset.collectValuesBy[key].range) {\n// collectedValues =\n// this.dataset.collectedValues[key][\n// path\n// .map(pathObj => {\n// return pathObj.value;\n// })\n// .join(this.dataset.stringJoinChar)\n// ];\n// break;\n// }\n// }\n// let width;\n// if (this._chartItemBandSize) {\n// // width = (collectedValues?.length ?? 0) * this._chartItemBandSize;\n// width = scaleWholeRangeSize(\n// collectedValues?.length ?? 0,\n// this._chartItemBandSize,\n// this._chartPaddingInner,\n// this._chartPaddingOuter\n// );\n// } else {\n// const barWidth = this._chartItemSpanSize || 25;\n// width = (collectedValues?.length ?? 0) * (barWidth + barWidth / 3);\n// }\n\n// const padding = getQuadProps(this._chartPadding ?? (this._table.theme.bodyStyle.padding as number) ?? 0);\n// return width + padding[1] + padding[3];\n// }\n// /** 获取某一图表列的最优高度,计算逻辑是根据图表的yField的维度值个数 * barWidth */\n// getOptimunHeightForChart(row: number) {\n// const path = this.getCellHeaderPaths(this.rowHeaderLevelCount, row).rowHeaderPaths;\n// let collectedValues: any;\n// for (const key in this.dataset.collectValuesBy) {\n// if (this.dataset.collectValuesBy[key].type === 'yField' && !this.dataset.collectValuesBy[key].range) {\n// collectedValues =\n// this.dataset.collectedValues[key][\n// path\n// .map(pathObj => {\n// return pathObj.value;\n// })\n// .join(this.dataset.stringJoinChar)\n// ];\n// break;\n// }\n// }\n// let height;\n// if (this._chartItemBandSize) {\n// // height = (collectedValues?.length ?? 0) * this._chartItemBandSize;\n// height = scaleWholeRangeSize(\n// collectedValues?.length ?? 0,\n// this._chartItemBandSize,\n// this._chartPaddingInner,\n// this._chartPaddingOuter\n// );\n// } else {\n// const barWidth = this._chartItemSpanSize || 25;\n// height = (collectedValues?.length ?? 0) * (barWidth + barWidth / 3);\n// }\n// const padding = getQuadProps(this._chartPadding ?? (this._table.theme.bodyStyle.padding as number) ?? 0);\n// return height + padding[0] + padding[2];\n// }\n// /**\n// * 获取图表对应的指标值\n// * */\n// getIndicatorKeyInChartSpec(_col: number, _row: number) {\n// // const paths = this.getCellHeaderPaths(_col, _row);\n// // let indicatorObj;\n// // if (this.indicatorsAsCol) {\n// // const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n// // indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// // } else {\n// // const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n// // indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// // }\n// // const chartSpec = indicatorObj?.chartSpec;\n// const chartSpec = this.getRawChartSpec(_col, _row);\n// const indicatorKeys: string[] = [];\n// if (chartSpec) {\n// if (this.indicatorsAsCol === false) {\n// if (chartSpec.series) {\n// chartSpec.series.forEach((chartSeries: any) => {\n// const yField = chartSeries.yField;\n// indicatorKeys.push(yField);\n// });\n// } else {\n// indicatorKeys.push(chartSpec.yField);\n// }\n// } else {\n// if (chartSpec.series) {\n// chartSpec.series.forEach((chartSeries: any) => {\n// const xField = chartSeries.xField;\n// indicatorKeys.push(xField);\n// });\n// } else {\n// indicatorKeys.push(chartSpec.xField);\n// }\n// }\n// return indicatorKeys;\n// }\n// return null;\n// }\n\n// /**\n// * 获取图表对应的指标值\n// * */\n// getDimensionKeyInChartSpec(_col: number, _row: number) {\n// // const paths = this.getCellHeaderPaths(_col, _row);\n// // let indicatorObj;\n// // if (this.indicatorsAsCol) {\n// // const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n// // indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// // } else {\n// // const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n// // indicatorObj = this._indicatorObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n// // }\n// // const chartSpec = indicatorObj?.chartSpec;\n// const chartSpec = this.getRawChartSpec(_col, _row);\n// const dimensionKeys: string[] = [];\n// if (chartSpec) {\n// if (this.indicatorsAsCol === false) {\n// dimensionKeys.push(chartSpec.xField ?? chartSpec?.series[0]?.xField);\n// } else {\n// dimensionKeys.push(chartSpec.yField ?? chartSpec?.series[0]?.yField);\n// }\n// return dimensionKeys;\n// }\n// return null;\n// }\n\n// getAxisConfigInPivotChart(col: number, row: number): any {\n// return getAxisConfigInPivotChart(col, row, this);\n// }\n// getRawChartSpec(col: number, row: number): any {\n// return getRawChartSpec(col, row, this);\n// }\n// getChartSpec(col: number, row: number): any {\n// return getChartSpec(col, row, this);\n// }\n// getChartAxes(col: number, row: number): any {\n// return getChartAxes(col, row, this);\n// }\n// getChartDataId(col: number, row: number): any {\n// return getChartDataId(col, row, this);\n// }\n// isEmpty(col: number, row: number): boolean {\n// if (!this._table.isPivotChart()) {\n// return false;\n// }\n// if (col > this.colCount - this.rightFrozenColCount - 1 || row > this.rowCount - this.bottomFrozenRowCount - 1) {\n// return true;\n// }\n// if (this.hasTwoIndicatorAxes && this.indicatorsAsCol && row === this.columnHeaderLevelCount - 1) {\n// return true;\n// }\n// return false;\n// }\n// //#endregion\n// release() {\n// const activeChartInstance = (this._table as PivotChart)._getActiveChartInstance();\n// activeChartInstance?.release();\n// this._indicatorObjects.forEach(indicatorObject => {\n// indicatorObject.chartInstance?.release();\n// });\n// }\n\n// clearCellRangeMap() {\n// // do nothing\n// }\n// }\n\n// // FIXME: 等 vscale 暴露这两个方法后,删掉这两个方法\n\n// /** 计算 scale 的实际 range 长度 */\n// function scaleWholeRangeSize(count: number, bandwidth: number, paddingInner: number, paddingOuter: number) {\n// if (paddingInner === 1) {\n// paddingInner = 0; // 保护\n// // FIXME: vscale 同样需要加保护,目前这里加了保护以后,在 paddingInner为 1 的情况还是会崩溃\n// }\n// const space = bandSpace(count, paddingInner, paddingOuter);\n// const step = bandwidth / (1 - paddingInner);\n// const wholeSize = space * step;\n// return wholeSize;\n// }\n\n// function bandSpace(count: number, paddingInner: number, paddingOuter: number): number {\n// let space;\n// // count 等于 1 时需要特殊处理,否则 step 会超出 range 范围\n// // 计算公式: step = paddingOuter * step * 2 + paddingInner * step + bandwidth\n// if (count === 1) {\n// space = count + paddingOuter * 2;\n// } else {\n// space = count - paddingInner + paddingOuter * 2;\n// }\n// return count ? (space > 0 ? space : 1) : 0;\n// }\n"]}
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
- //# sourceMappingURL=pivot-layout.js.map