@visactor/vtable 1.5.5 → 1.5.6
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.
- package/cjs/ListTable.js +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -0
- package/cjs/PivotChart.js +4 -0
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/axis/axis.js +3 -2
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +2 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -0
- package/cjs/core/BaseTable.js +44 -24
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.d.ts +1 -0
- package/cjs/core/FouseInput.js +5 -2
- package/cjs/core/FouseInput.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/core/utils/get-cell-position.d.ts +5 -25
- package/cjs/core/utils/get-cell-position.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/util.js +2 -2
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +4 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +1 -0
- package/cjs/scenegraph/graphic/chart.js +34 -20
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +56 -16
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
- package/cjs/scenegraph/refresh-node/update-chart.js +84 -32
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js +14 -8
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/resize/update-resize-row.js +1 -1
- package/cjs/state/resize/update-resize-row.js.map +1 -1
- package/cjs/state/state.js +2 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +12 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +433 -169
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -0
- package/es/PivotChart.js +5 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/components/axis/axis.js +3 -1
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +2 -1
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -0
- package/es/core/BaseTable.js +43 -23
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.d.ts +1 -0
- package/es/core/FouseInput.js +5 -2
- package/es/core/FouseInput.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -2
- package/es/core/tableHelper.js.map +1 -1
- package/es/core/utils/get-cell-position.d.ts +5 -25
- package/es/core/utils/get-cell-position.js.map +1 -1
- package/es/event/event.js +2 -1
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/util.js +2 -2
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +4 -1
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +1 -0
- package/es/scenegraph/graphic/chart.js +33 -21
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +57 -15
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
- package/es/scenegraph/refresh-node/update-chart.js +81 -29
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js +14 -8
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/resize/update-resize-row.js +1 -1
- package/es/state/resize/update-resize-row.js.map +1 -1
- package/es/state/state.js +2 -2
- package/es/state/state.js.map +1 -1
- package/es/tools/helper.js.map +1 -1
- package/es/ts-types/base-table.d.ts +12 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
|
@@ -2,5 +2,6 @@ import type { Scenegraph } from '../scenegraph';
|
|
|
2
2
|
export declare function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number): void;
|
|
3
3
|
export declare function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number): void;
|
|
4
4
|
export declare function clearChartCacheImage(scenegraph: Scenegraph): void;
|
|
5
|
+
export declare function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph): void;
|
|
5
6
|
export declare function updateChartData(scenegraph: Scenegraph): void;
|
|
6
7
|
export declare function updateChartState(scenegraph: Scenegraph, datum: any): void;
|
|
@@ -2,45 +2,82 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.updateChartState = exports.updateChartData = exports.clearChartCacheImage = exports.updateChartSizeForResizeRowHeight = exports.updateChartSizeForResizeColWidth = void 0;
|
|
5
|
+
}), exports.updateChartState = exports.updateChartData = exports.clearCellChartCacheImage = exports.clearChartCacheImage = exports.updateChartSizeForResizeRowHeight = exports.updateChartSizeForResizeColWidth = void 0;
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), factory_1 = require("../../core/factory"), padding_1 = require("../utils/padding"), get_prop_1 = require("../utils/get-prop");
|
|
8
8
|
|
|
9
9
|
function updateChartSizeForResizeColWidth(scenegraph, col) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const columnGroup = scenegraph.getColGroup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
|
|
22
|
-
const columnGroup = scenegraph.getColGroup(c);
|
|
23
|
-
null === (_b = null == columnGroup ? void 0 : columnGroup.getChildren()) || void 0 === _b || _b.forEach((cellNode => {
|
|
24
|
-
const width = scenegraph.table.getColWidth(cellNode.col), height = scenegraph.table.getRowHeight(cellNode.row);
|
|
25
|
-
cellNode.children.forEach((node => {
|
|
26
|
-
"chart" === node.type && (node.cacheCanvas = null, node.setAttribute("width", Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])),
|
|
27
|
-
node.setAttribute("height", Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])));
|
|
10
|
+
const {table: table} = scenegraph, layout = table.internalProps.layoutMap, columnResizeType = -1 === col ? "all" : table.internalProps.columnResizeType;
|
|
11
|
+
if ("column" === columnResizeType) {
|
|
12
|
+
const columnGroup = scenegraph.getColGroup(col);
|
|
13
|
+
if (null == columnGroup || columnGroup.forEachChildren((cellNode => {
|
|
14
|
+
updateChartGraphicSize(cellNode, table.getColWidth(cellNode.col), table.getRowHeight(cellNode.row));
|
|
15
|
+
})), "adaptive" === table.widthMode && col < table.colCount - 1) {
|
|
16
|
+
const columnGroup = scenegraph.getColGroup(col + 1);
|
|
17
|
+
null == columnGroup || columnGroup.forEachChildren((cellNode => {
|
|
18
|
+
updateChartGraphicSize(cellNode, table.getColWidth(cellNode.col), table.getRowHeight(cellNode.row));
|
|
28
19
|
}));
|
|
29
|
-
}
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
let resizeIndicatorKey, resizeDimensionKey, resizeDimensionValue, startCol = table.rowHeaderLevelCount, endCol = table.colCount - 1;
|
|
23
|
+
if ("indicator" === columnResizeType) if (layout.indicatorsAsCol) resizeIndicatorKey = layout.getIndicatorKey(col, table.columnHeaderLevelCount); else {
|
|
24
|
+
const headerPaths = layout.getCellHeaderPaths(col, table.columnHeaderLevelCount - 1), headerPath = headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];
|
|
25
|
+
resizeDimensionKey = headerPath.dimensionKey, resizeDimensionValue = headerPath.value;
|
|
26
|
+
} else if ("indicatorGroup" === columnResizeType) {
|
|
27
|
+
const layout = table.internalProps.layoutMap, headerPaths = layout.getCellHeaderPaths(table.stateManager.columnResize.col, table.columnHeaderLevelCount), node = layout.getHeadNodeByRowOrColDimensions(headerPaths.colHeaderPaths.slice(0, headerPaths.colHeaderPaths.length - 1));
|
|
28
|
+
startCol = node.startInTotal + table.frozenColCount, endCol = node.startInTotal + table.frozenColCount + node.size - 1;
|
|
29
|
+
}
|
|
30
|
+
for (let c = startCol; c <= endCol; c++) {
|
|
31
|
+
const columnGroup = scenegraph.getColGroup(c);
|
|
32
|
+
if (columnGroup) {
|
|
33
|
+
if ("indicator" === columnResizeType) {
|
|
34
|
+
const indicatorKey = layout.getIndicatorKey(c, table.columnHeaderLevelCount);
|
|
35
|
+
if (layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) continue;
|
|
36
|
+
if (!layout.indicatorsAsCol) {
|
|
37
|
+
const headerPaths = layout.getCellHeaderPaths(c, table.columnHeaderLevelCount - 1), headerPath = null == headerPaths ? void 0 : headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];
|
|
38
|
+
if (!headerPath || resizeDimensionKey !== headerPath.dimensionKey || resizeDimensionValue !== headerPath.value) continue;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
columnGroup.forEachChildren((cellNode => {
|
|
42
|
+
updateChartGraphicSize(cellNode, table.getColWidth(cellNode.col), table.getRowHeight(cellNode.row));
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
30
46
|
}
|
|
31
47
|
}
|
|
32
48
|
|
|
33
49
|
function updateChartSizeForResizeRowHeight(scenegraph, row) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
var _a;
|
|
51
|
+
const {table: table} = scenegraph, layout = table.internalProps.layoutMap, state = table.stateManager, rowResizeType = -1 === row ? "all" : table.internalProps.rowResizeType;
|
|
52
|
+
let resizeIndicatorKey, resizeDimensionKey, resizeDimensionValue, startRow = table.columnHeaderLevelCount, endRow = table.rowCount - 1;
|
|
53
|
+
if ("indicator" === rowResizeType) if (layout.indicatorsAsCol) {
|
|
54
|
+
const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount - 1, row), headerPath = null === (_a = headerPaths.rowHeaderPaths) || void 0 === _a ? void 0 : _a[headerPaths.rowHeaderPaths.length - 1];
|
|
55
|
+
resizeDimensionKey = null == headerPath ? void 0 : headerPath.dimensionKey, resizeDimensionValue = null == headerPath ? void 0 : headerPath.value;
|
|
56
|
+
} else resizeIndicatorKey = layout.getIndicatorKey(table.rowHeaderLevelCount, row); else if ("indicatorGroup" === rowResizeType) {
|
|
57
|
+
const layout = table.internalProps.layoutMap, headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount, row), node = layout.getHeadNodeByRowOrColDimensions(headerPaths.rowHeaderPaths.slice(0, headerPaths.rowHeaderPaths.length - 1));
|
|
58
|
+
startRow = node.startInTotal + table.frozenRowCount, endRow = node.startInTotal + table.frozenRowCount + node.size - 1;
|
|
59
|
+
}
|
|
60
|
+
for (let col = scenegraph.proxy.colStart; col <= scenegraph.proxy.colEnd; col++) if ("row" === rowResizeType) {
|
|
61
|
+
const cellNode = scenegraph.highPerformanceGetCell(col, row);
|
|
62
|
+
if ("cell" !== cellNode.role) continue;
|
|
63
|
+
if (updateChartGraphicSize(cellNode, table.getColWidth(cellNode.col), table.getRowHeight(cellNode.row)),
|
|
64
|
+
"adaptive" === table.heightMode && row < table.rowCount - 1) {
|
|
65
|
+
const cellNode = scenegraph.highPerformanceGetCell(col, row + 1);
|
|
66
|
+
updateChartGraphicSize(cellNode, table.getColWidth(cellNode.col), table.getRowHeight(cellNode.row));
|
|
67
|
+
}
|
|
68
|
+
} else for (let r = startRow; r <= endRow; r++) {
|
|
69
|
+
if ("indicator" === rowResizeType) {
|
|
70
|
+
const indicatorKey = layout.getIndicatorKey(state.table.rowHeaderLevelCount, r);
|
|
71
|
+
if (!layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) continue;
|
|
72
|
+
if (layout.indicatorsAsCol) {
|
|
73
|
+
const headerPaths = layout.getCellHeaderPaths(state.table.rowHeaderLevelCount - 1, r), headerPath = null == headerPaths ? void 0 : headerPaths.rowHeaderPaths[headerPaths.rowHeaderPaths.length - 1];
|
|
74
|
+
if (!headerPath || resizeDimensionKey !== headerPath.dimensionKey || resizeDimensionValue !== headerPath.value) continue;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const cellNode = scenegraph.highPerformanceGetCell(col, r);
|
|
78
|
+
if ("cell" !== cellNode.role) continue;
|
|
79
|
+
updateChartGraphicSize(cellNode, table.getColWidth(cellNode.col), table.getRowHeight(cellNode.row));
|
|
80
|
+
}
|
|
44
81
|
}
|
|
45
82
|
|
|
46
83
|
function clearChartCacheImage(scenegraph) {
|
|
@@ -55,6 +92,12 @@ function clearChartCacheImage(scenegraph) {
|
|
|
55
92
|
}
|
|
56
93
|
}
|
|
57
94
|
|
|
95
|
+
function clearCellChartCacheImage(col, row, scenegraph) {
|
|
96
|
+
scenegraph.getCell(col, row).children.forEach((node => {
|
|
97
|
+
"chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
|
|
58
101
|
function updateChartData(scenegraph) {
|
|
59
102
|
var _a;
|
|
60
103
|
const table = scenegraph.table;
|
|
@@ -116,7 +159,16 @@ function updateTableAxes(containerGroup, table) {
|
|
|
116
159
|
}));
|
|
117
160
|
}
|
|
118
161
|
|
|
162
|
+
function updateChartGraphicSize(cellNode, width, height) {
|
|
163
|
+
cellNode.forEachChildren((graphic => {
|
|
164
|
+
"chart" === graphic.type && (graphic.cacheCanvas = null, graphic.setAttributes({
|
|
165
|
+
width: Math.ceil(width - graphic.attribute.cellPadding[3] - graphic.attribute.cellPadding[1]),
|
|
166
|
+
height: Math.ceil(height - graphic.attribute.cellPadding[0] - graphic.attribute.cellPadding[2])
|
|
167
|
+
}));
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
|
|
119
171
|
exports.updateChartSizeForResizeColWidth = updateChartSizeForResizeColWidth, exports.updateChartSizeForResizeRowHeight = updateChartSizeForResizeRowHeight,
|
|
120
|
-
exports.clearChartCacheImage = clearChartCacheImage, exports.
|
|
121
|
-
exports.updateChartState = updateChartState;
|
|
172
|
+
exports.clearChartCacheImage = clearChartCacheImage, exports.clearCellChartCacheImage = clearCellChartCacheImage,
|
|
173
|
+
exports.updateChartData = updateChartData, exports.updateChartState = updateChartState;
|
|
122
174
|
//# sourceMappingURL=update-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAG3C,gDAA6C;AAM7C,8CAAgD;AAChD,gDAA4C;AAG5C,SAAgB,gCAAgC,CAAC,UAAsB,EAAE,GAAW;;IAElF,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAG9C,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,EAAE,0CAAE,OAAO,CAAC,CAAC,QAAe,EAAE,EAAE;YACtD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACzD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAE3D,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAW,EAAE,EAAE;gBACxC,IAAK,IAAY,CAAC,IAAI,KAAK,OAAO,EAAE;oBAoBlC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;oBACxB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,WAA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CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;wBAC1D,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,IAAA,kBAAO,EAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;wBACvF,MAAM,aAAa,GAAmB,iBAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;wBACnE,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;wBACxG,IAAI,CAAC,KAAK,EAAE,CAAC;wBACb,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBACjC,IAAI,CAAC,OAAO,EAAE,CAAC;qBAChB;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"update-chart.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = col; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n // const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n // if (chartInstance) {\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n // 调试问题使用\n // if (columnGroup.col === 2) {\n // columnGroup.AABBBounds.width();\n // node.AABBBounds.width();\n // console.log(\n // 'set viewbox y1',\n // Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n // node.globalAABBBounds.height()\n // );\n\n // console.log(\n // 'updateChartSize',\n // columnGroup,\n // columnGroup.globalAABBBounds.y1,\n // cellNode.globalAABBBounds.y1,\n // node.globalAABBBounds.y1\n // );\n // }\n\n node.cacheCanvas = null;\n node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n\n // node.setAttribute('viewBox', {\n // x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),\n // x2: Math.ceil(\n // cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft\n // ),\n // y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n // y2: Math.ceil(\n // cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop\n // )\n // });\n }\n });\n });\n // }\n }\n // 右侧冻结的单元格也需要调整\n if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {\n for (\n let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n c <= scenegraph.table.colCount - 1;\n c++\n ) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.setAttribute(\n 'width',\n Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n );\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n }\n });\n });\n }\n }\n}\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number) {\n const updateCellNode = (c: number, r: number) => {\n const cellNode = scenegraph.getCell(c, r);\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n console.log('bf', c, r, node.attribute.width, node.attribute.height);\n\n node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));\n console.log('af', c, r, node.attribute.width, node.attribute.height);\n }\n });\n };\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n updateCellNode(c, r);\n }\n }\n\n // 右侧冻结的单元格也需要调整\n if (scenegraph.table.rightFrozenColCount >= 1) {\n for (\n let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n c <= scenegraph.table.colCount - 1;\n c++\n ) {\n for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n updateCellNode(c, r);\n }\n }\n }\n // 左侧冻结的单元格\n if (scenegraph.table.frozenColCount >= 1) {\n for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {\n for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n updateCellNode(c, r);\n }\n }\n }\n}\n/** 清理所有chart节点的 图表缓存图片 */\nexport function clearChartCacheImage(scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n });\n }\n}\n\n/** 更新所有的图表chart节点上缓存attribute中的data数据 */\nexport function updateChartData(scenegraph: Scenegraph) {\n const table = scenegraph.table;\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const col = cellNode.col;\n const row = cellNode.row;\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.updateData(table.getCellValue(col, row));\n const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);\n node.setAttribute('axes', newAxes);\n const chartSpec = node.attribute.spec;\n chartSpec.axes = newAxes;\n node.setAttribute('spec', chartSpec);\n // node.addUpdateBoundTag();\n }\n });\n });\n }\n\n // update left axes\n updateTableAxes(scenegraph.rowHeaderGroup, scenegraph.table);\n // update top axes\n updateTableAxes(scenegraph.colHeaderGroup, scenegraph.table);\n // update right axes\n updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table);\n // update bottom axes\n updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);\n}\n/** 组织图表数据状态_selectedDataItemsInChart 更新选中的图表图元状态 */\nexport function updateChartState(scenegraph: Scenegraph, datum: any) {\n const table = scenegraph.table;\n if (table.isPivotChart()) {\n const preSelectItemsCount = (table as PivotChart)._selectedDataItemsInChart.length;\n if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {};\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {};\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAG3C,gDAA6C;AAM7C,8CAAgD;AAChD,gDAA4C;AAG5C,SAAgB,gCAAgC,CAAC,UAAsB,EAAE,GAAW;IAClF,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;IAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,SAAiC,CAAC;IACrE,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IAEnF,IAAI,gBAAgB,KAAK,QAAQ,EAAE;QACjC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAChD,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,CAAC,CAAC,QAAe,EAAE,EAAE;YAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAChD,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,SAAS,KAAK,UAAU,IAAI,GAAG,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,EA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AAe,CAAC,CAAC,OAAc,EAAE,EAAE;QAC1C,IAAK,OAAe,CAAC,IAAI,KAAK,OAAO,EAAE;YACrC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;YAC3B,OAAO,CAAC,aAAa,CAAC;gBACpB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC7F,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;aAChG,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"update-chart.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\nimport type { PivotChart } from '../../PivotChart';\nimport type { ICartesianAxis } from '../../components/axis/axis';\nimport { Factory } from '../../core/factory';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeColWidth(scenegraph: Scenegraph, col: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const columnResizeType = col === -1 ? 'all' : table.internalProps.columnResizeType;\n\n if (columnResizeType === 'column') {\n const columnGroup = scenegraph.getColGroup(col);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n if (table.widthMode === 'adaptive' && col < table.colCount - 1) {\n const columnGroup = scenegraph.getColGroup(col + 1);\n columnGroup?.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n } else {\n let startCol = table.rowHeaderLevelCount;\n let endCol = table.colCount - 1;\n let resizeIndicatorKey;\n let resizeDimensionKey;\n let resizeDimensionValue;\n if (columnResizeType === 'indicator') {\n if (layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(col, table.columnHeaderLevelCount);\n } else {\n const headerPaths = layout.getCellHeaderPaths(col, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n resizeDimensionKey = headerPath.dimensionKey;\n resizeDimensionValue = headerPath.value;\n }\n } else if (columnResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.stateManager.columnResize.col, table.columnHeaderLevelCount);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.colHeaderPaths.slice(0, headerPaths.colHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startCol = node.startInTotal + table.frozenColCount;\n endCol = node.startInTotal + table.frozenColCount + node.size - 1;\n }\n\n for (let c = startCol; c <= endCol; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n if (columnGroup) {\n if (columnResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(c, table.columnHeaderLevelCount);\n if (layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (!layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(c, table.columnHeaderLevelCount - 1);\n const headerPath = headerPaths?.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n columnGroup.forEachChildren((cellNode: Group) => {\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n });\n }\n }\n }\n\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = col; c <= scenegraph.proxy.colEnd; c++) {\n // const columnGroup = scenegraph.getColGroup(c);\n // // const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n // // if (chartInstance) {\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // // }\n // }\n // // 右侧冻结的单元格也需要调整\n // if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // const columnGroup = scenegraph.getColGroup(c);\n // columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // node.setAttribute(\n // 'width',\n // Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n // );\n // node.setAttribute(\n // 'height',\n // Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n // );\n // }\n // });\n // });\n // }\n // }\n}\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSizeForResizeRowHeight(scenegraph: Scenegraph, row: number) {\n const { table } = scenegraph;\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const state = table.stateManager;\n const rowResizeType = row === -1 ? 'all' : table.internalProps.rowResizeType;\n\n let startRow = table.columnHeaderLevelCount;\n let endRow = table.rowCount - 1;\n let resizeIndicatorKey;\n let resizeDimensionKey;\n let resizeDimensionValue;\n if (rowResizeType === 'indicator') {\n if (!layout.indicatorsAsCol) {\n resizeIndicatorKey = layout.getIndicatorKey(table.rowHeaderLevelCount, row);\n } else {\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount - 1, row);\n const headerPath = headerPaths.rowHeaderPaths?.[headerPaths.rowHeaderPaths.length - 1];\n resizeDimensionKey = headerPath?.dimensionKey;\n resizeDimensionValue = headerPath?.value;\n }\n } else if (rowResizeType === 'indicatorGroup') {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n //通过getCellHeaderPaths接口获取列表头最后一层指标维度的path\n const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount, row);\n const node = layout.getHeadNodeByRowOrColDimensions(\n headerPaths.rowHeaderPaths.slice(0, headerPaths.rowHeaderPaths.length - 1)\n ) as any;\n // 计算宽度受影响列的起止\n startRow = node.startInTotal + table.frozenRowCount;\n endRow = node.startInTotal + table.frozenRowCount + node.size - 1;\n }\n\n for (let col = scenegraph.proxy.colStart; col <= scenegraph.proxy.colEnd; col++) {\n if (rowResizeType === 'row') {\n const cellNode = scenegraph.highPerformanceGetCell(col, row);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n\n if (table.heightMode === 'adaptive' && row < table.rowCount - 1) {\n const cellNode = scenegraph.highPerformanceGetCell(col, row + 1);\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n } else {\n for (let r = startRow; r <= endRow; r++) {\n if (rowResizeType === 'indicator') {\n const indicatorKey = layout.getIndicatorKey(state.table.rowHeaderLevelCount, r);\n if (!layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {\n continue;\n } else if (layout.indicatorsAsCol) {\n const headerPaths = layout.getCellHeaderPaths(state.table.rowHeaderLevelCount - 1, r);\n const headerPath = headerPaths?.rowHeaderPaths[headerPaths.rowHeaderPaths.length - 1];\n if (\n !headerPath ||\n resizeDimensionKey !== headerPath.dimensionKey ||\n resizeDimensionValue !== headerPath.value\n ) {\n continue;\n }\n }\n }\n const cellNode = scenegraph.highPerformanceGetCell(col, r);\n if (cellNode.role !== 'cell') {\n continue;\n }\n const width = table.getColWidth(cellNode.col);\n const height = table.getRowHeight(cellNode.row);\n updateChartGraphicSize(cellNode, width, height);\n }\n }\n }\n\n // const updateCellNode = (c: number, r: number) => {\n // const cellNode = scenegraph.getCell(c, r);\n // const width = scenegraph.table.getColWidth(cellNode.col);\n // const height = scenegraph.table.getRowHeight(cellNode.row);\n // cellNode.children.forEach((node: Chart) => {\n // if ((node as any).type === 'chart') {\n // node.cacheCanvas = null;\n // console.log('bf', c, r, node.attribute.width, node.attribute.height);\n\n // node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));\n // node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));\n // console.log('af', c, r, node.attribute.width, node.attribute.height);\n // }\n // });\n // };\n // // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n // for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n\n // // 右侧冻结的单元格也需要调整\n // if (scenegraph.table.rightFrozenColCount >= 1) {\n // for (\n // let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount;\n // c <= scenegraph.table.colCount - 1;\n // c++\n // ) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n // // 左侧冻结的单元格\n // if (scenegraph.table.frozenColCount >= 1) {\n // for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {\n // for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {\n // updateCellNode(c, r);\n // }\n // }\n // }\n}\n/** 清理所有chart节点的 图表缓存图片 */\nexport function clearChartCacheImage(scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n });\n }\n}\n\nexport function clearCellChartCacheImage(col: number, row: number, scenegraph: Scenegraph) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n const cellGroup = scenegraph.getCell(col, row);\n cellGroup.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.addUpdateBoundTag();\n }\n });\n}\n\n/** 更新所有的图表chart节点上缓存attribute中的data数据 */\nexport function updateChartData(scenegraph: Scenegraph) {\n const table = scenegraph.table;\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n columnGroup?.getChildren()?.forEach((cellNode: Group) => {\n const col = cellNode.col;\n const row = cellNode.row;\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.updateData(table.getCellValue(col, row));\n const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);\n node.setAttribute('axes', newAxes);\n const chartSpec = node.attribute.spec;\n chartSpec.axes = newAxes;\n node.setAttribute('spec', chartSpec);\n // node.addUpdateBoundTag();\n }\n });\n });\n }\n\n // update left axes\n updateTableAxes(scenegraph.rowHeaderGroup, scenegraph.table);\n // update top axes\n updateTableAxes(scenegraph.colHeaderGroup, scenegraph.table);\n // update right axes\n updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table);\n // update bottom axes\n updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);\n}\n/** 组织图表数据状态_selectedDataItemsInChart 更新选中的图表图元状态 */\nexport function updateChartState(scenegraph: Scenegraph, datum: any) {\n const table = scenegraph.table;\n if (table.isPivotChart()) {\n const preSelectItemsCount = (table as PivotChart)._selectedDataItemsInChart.length;\n if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {\n //避免无效的更新\n return;\n }\n // (table as PivotChart)._selectedDataItemsInChart = [];\n const newSelectedDataItemsInChart = [];\n if (Array.isArray(datum)) {\n datum.forEach((dataItem: any) => {\n if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in dataItem) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = dataItem[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n });\n } else if (datum && datum.key !== 0 && Object.keys(datum).length > 0) {\n //本以为没有点击到图元上 datum为空 发现是{key:0}或者{}\n const selectedState = {} as any;\n for (const itemKey in datum) {\n if (!itemKey.startsWith('VGRAMMAR_') && !itemKey.startsWith('__VCHART')) {\n selectedState[itemKey] = datum[itemKey];\n }\n }\n newSelectedDataItemsInChart.push(selectedState);\n }\n //避免无效的更新\n if (!isEqual((table as PivotChart)._selectedDataItemsInChart, newSelectedDataItemsInChart)) {\n (table as PivotChart)._selectedDataItemsInChart = newSelectedDataItemsInChart;\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).updateDataStateToChartInstance();\n // 清楚chart缓存图片\n clearChartCacheImage(scenegraph);\n table.scenegraph.updateNextFrame();\n }\n }\n}\n\n/**\n * @description: update table axis component\n * @param {Group} containerGroup\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction updateTableAxes(containerGroup: Group, table: BaseTableAPI) {\n containerGroup.forEachChildren((column: Group) => {\n if (column.role === 'column') {\n column.forEachChildren((cell: Group) => {\n if (cell.role === 'cell') {\n let isAxisComponent = false;\n cell.forEachChildren((mark: Group) => {\n if (mark.name === 'axis') {\n isAxisComponent = true;\n return true;\n }\n return false;\n });\n if (isAxisComponent) {\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(cell.col, cell.row);\n const cellStyle = table._getCellStyle(cell.col, cell.row);\n const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));\n const CartesianAxis: ICartesianAxis = Factory.getComponent('axis');\n const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);\n cell.clear();\n cell.appendChild(axis.component);\n axis.overlap();\n }\n }\n });\n }\n });\n}\n\nfunction updateChartGraphicSize(cellNode: Group, width: number, height: number) {\n cellNode.forEachChildren((graphic: Chart) => {\n if ((graphic as any).type === 'chart') {\n graphic.cacheCanvas = null;\n graphic.setAttributes({\n width: Math.ceil(width - graphic.attribute.cellPadding[3] - graphic.attribute.cellPadding[1]),\n height: Math.ceil(height - graphic.attribute.cellPadding[0] - graphic.attribute.cellPadding[2])\n });\n }\n });\n}\n"]}
|
|
@@ -100,7 +100,7 @@ export declare class Scenegraph {
|
|
|
100
100
|
recreateAllSelectRangeComponents(): void;
|
|
101
101
|
updateColWidth(col: number, detaX: number, skipUpdateContainer?: boolean, skipTableWidthMap?: boolean): void;
|
|
102
102
|
updateChartSizeForResizeColWidth(col: number): void;
|
|
103
|
-
updateChartSizeForResizeRowHeight(
|
|
103
|
+
updateChartSizeForResizeRowHeight(row: number): void;
|
|
104
104
|
updateChartState(datum: any): void;
|
|
105
105
|
updateCheckboxCellState(col: number, row: number, checked: boolean): void;
|
|
106
106
|
updateHeaderCheckboxCellState(col: number, row: number, checked: boolean | 'indeterminate'): void;
|
|
@@ -20,7 +20,8 @@ class Scenegraph {
|
|
|
20
20
|
let width, height;
|
|
21
21
|
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0,
|
|
22
22
|
this.mergeMap = new Map, (0, vrender_components_1.setPoptipTheme)(this.table.theme.textPopTipStyle),
|
|
23
|
-
|
|
23
|
+
table.options.canvas && table.options.viewBox ? (vrender_1.vglobal.setEnv("browser"),
|
|
24
|
+
width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : "node" === env_1.Env.mode ? (vrender_1.vglobal.setEnv("node", table.options.modeParams),
|
|
24
25
|
width = table.canvasWidth, height = table.canvasHeight) : (vrender_1.vglobal.setEnv("browser"),
|
|
25
26
|
width = table.canvas.width, height = table.canvas.height), this.stage = (0, vrender_1.createStage)(Object.assign({
|
|
26
27
|
canvas: table.canvas,
|
|
@@ -30,9 +31,14 @@ class Scenegraph {
|
|
|
30
31
|
background: table.theme.underlayBackgroundColor,
|
|
31
32
|
dpr: table.internalProps.pixelRatio,
|
|
32
33
|
enableLayout: !0,
|
|
33
|
-
|
|
34
|
-
this.table.
|
|
35
|
-
}
|
|
34
|
+
beforeRender: stage => {
|
|
35
|
+
this.table.options.beforeRender && this.table.options.beforeRender(stage);
|
|
36
|
+
},
|
|
37
|
+
afterRender: stage => {
|
|
38
|
+
this.table.options.afterRender && this.table.options.afterRender(stage), this.table.fireListeners("after_render", null);
|
|
39
|
+
},
|
|
40
|
+
canvasControled: !table.options.canvas,
|
|
41
|
+
viewBox: table.options.viewBox
|
|
36
42
|
}, table.options.renderOption)), this.stage.defaultLayer.setTheme({
|
|
37
43
|
group: {
|
|
38
44
|
boundsPadding: 0,
|
|
@@ -299,8 +305,8 @@ class Scenegraph {
|
|
|
299
305
|
updateChartSizeForResizeColWidth(col) {
|
|
300
306
|
(0, update_chart_1.updateChartSizeForResizeColWidth)(this, col);
|
|
301
307
|
}
|
|
302
|
-
updateChartSizeForResizeRowHeight(
|
|
303
|
-
(0, update_chart_1.updateChartSizeForResizeRowHeight)(this,
|
|
308
|
+
updateChartSizeForResizeRowHeight(row) {
|
|
309
|
+
(0, update_chart_1.updateChartSizeForResizeRowHeight)(this, row);
|
|
304
310
|
}
|
|
305
311
|
updateChartState(datum) {
|
|
306
312
|
this.table.isPivotChart() && (0, update_chart_1.updateChartState)(this, datum);
|
|
@@ -362,7 +368,7 @@ class Scenegraph {
|
|
|
362
368
|
this.proxy.resize(), ("adaptive" === this.table.widthMode || this.table.autoFillWidth) && (0 === this.table.internalProps._widthResizedColMap.size ? this.recalculateColWidths() : this.dealWidthMode()),
|
|
363
369
|
"adaptive" === this.table.heightMode ? 0 === this.table.internalProps._heightResizedRowMap.size ? this.recalculateRowHeights() : this.dealHeightMode() : this.table.autoFillHeight && this.dealHeightMode(),
|
|
364
370
|
this.resetFrozen(), this.updateTableSize(), this.updateBorderSizeAndPosition(),
|
|
365
|
-
this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.updateChartSizeForResizeColWidth(
|
|
371
|
+
this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.updateChartSizeForResizeColWidth(-1),
|
|
366
372
|
this.proxy.progress(), this.updateNextFrame();
|
|
367
373
|
}
|
|
368
374
|
updateTableSize() {
|
|
@@ -786,4 +792,4 @@ class Scenegraph {
|
|
|
786
792
|
}
|
|
787
793
|
|
|
788
794
|
exports.Scenegraph = Scenegraph;
|
|
789
|
-
//# sourceMappingURL=scenegraph.js.map
|
|
795
|
+
//# sourceMappingURL=scenegraph.js.map
|