@visactor/vtable 0.9.3-alpha.0 → 0.9.3-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.
- package/README.md +15 -15
- package/cjs/PivotChart.js +20 -10
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +1 -0
- package/cjs/dataset/dataset.js +11 -3
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +1 -2
- package/cjs/dataset/statistics-helper.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/layout/chart-helper/get-axis-config.js +18 -8
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +8 -2
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-layout.d.ts +1 -0
- package/cjs/layout/pivot-layout.js +12 -5
- package/cjs/layout/pivot-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +2 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +18 -22
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +60 -26
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +90 -36
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +2 -1
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +3 -2
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.js +4 -3
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +3 -3
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/dist/vtable.js +392 -141
- package/dist/vtable.min.js +3 -3
- package/es/PivotChart.js +20 -10
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.d.ts +1 -0
- package/es/dataset/dataset.js +11 -3
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +1 -2
- package/es/dataset/statistics-helper.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/layout/chart-helper/get-axis-config.js +19 -9
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +9 -3
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-layout.d.ts +1 -0
- package/es/layout/pivot-layout.js +12 -5
- package/es/layout/pivot-layout.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +2 -2
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +1 -1
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +17 -23
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +59 -23
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +90 -33
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +2 -1
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +3 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -1
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/hover/is-cell-hover.js +4 -3
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +3 -3
- package/es/ts-types/new-data-set.js.map +1 -1
- package/package.json +3 -3
package/dist/vtable.js
CHANGED
|
@@ -39565,23 +39565,25 @@
|
|
|
39565
39565
|
let absoluteLeftIconWidth = 0;
|
|
39566
39566
|
let absoluteRightIconWidth = 0;
|
|
39567
39567
|
if (!Array.isArray(icons) || icons.length === 0) {
|
|
39568
|
-
|
|
39569
|
-
|
|
39570
|
-
|
|
39571
|
-
|
|
39572
|
-
|
|
39573
|
-
|
|
39574
|
-
|
|
39575
|
-
|
|
39576
|
-
|
|
39577
|
-
|
|
39578
|
-
|
|
39579
|
-
|
|
39580
|
-
|
|
39581
|
-
|
|
39582
|
-
|
|
39583
|
-
|
|
39584
|
-
|
|
39568
|
+
if (textStr) {
|
|
39569
|
+
const text = convertInternal(textStr).replace(/\r?\n/g, '\n').replace(/\r/g, '\n').split('\n');
|
|
39570
|
+
const hierarchyOffset = getHierarchyOffset(cellGroup.col, cellGroup.row, table);
|
|
39571
|
+
const attribute = {
|
|
39572
|
+
text: text.length === 1 && !autoWrapText ? text[0] : text,
|
|
39573
|
+
maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
|
|
39574
|
+
textBaseline: 'top',
|
|
39575
|
+
autoWrapText,
|
|
39576
|
+
lineClamp,
|
|
39577
|
+
heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
|
|
39578
|
+
pickable: false,
|
|
39579
|
+
dx: hierarchyOffset
|
|
39580
|
+
};
|
|
39581
|
+
const wrapText = new WrapText(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
39582
|
+
wrapText.name = 'text';
|
|
39583
|
+
cellGroup.appendChild(wrapText);
|
|
39584
|
+
contentWidth = wrapText.AABBBounds.width();
|
|
39585
|
+
contentHeight = wrapText.AABBBounds.height();
|
|
39586
|
+
}
|
|
39585
39587
|
}
|
|
39586
39588
|
else {
|
|
39587
39589
|
icons.forEach(icon => {
|
|
@@ -40590,7 +40592,7 @@
|
|
|
40590
40592
|
else if (type === 'image' || type === 'video') {
|
|
40591
40593
|
updateImageCellContentWhileResize(cellGroup, col, row, scene.table);
|
|
40592
40594
|
}
|
|
40593
|
-
else if (cellGroup.firstChild
|
|
40595
|
+
else if (cellGroup.firstChild?.name === 'axis') {
|
|
40594
40596
|
const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
40595
40597
|
if (axisConfig) {
|
|
40596
40598
|
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);
|
|
@@ -41746,7 +41748,7 @@
|
|
|
41746
41748
|
for (const dataIdStr in dataId) {
|
|
41747
41749
|
const dataIdAndField = dataId[dataIdStr];
|
|
41748
41750
|
activeChartInstance.updateDataSync(dataIdStr, dataIdAndField
|
|
41749
|
-
? data
|
|
41751
|
+
? data?.filter((item) => {
|
|
41750
41752
|
return item.hasOwnProperty(dataIdAndField);
|
|
41751
41753
|
}) ?? []
|
|
41752
41754
|
: data ?? []);
|
|
@@ -41782,7 +41784,7 @@
|
|
|
41782
41784
|
for (const dataIdStr in dataId) {
|
|
41783
41785
|
const dataIdAndField = dataId[dataIdStr];
|
|
41784
41786
|
chartInstance.updateDataSync(dataIdStr, dataIdAndField
|
|
41785
|
-
? data
|
|
41787
|
+
? data?.filter((item) => {
|
|
41786
41788
|
return item.hasOwnProperty(dataIdAndField);
|
|
41787
41789
|
}) ?? []
|
|
41788
41790
|
: data ?? []);
|
|
@@ -41895,9 +41897,26 @@
|
|
|
41895
41897
|
if (!colorKey) {
|
|
41896
41898
|
return undefined;
|
|
41897
41899
|
}
|
|
41898
|
-
|
|
41899
|
-
|
|
41900
|
-
|
|
41900
|
+
let hoverStyle;
|
|
41901
|
+
const layout = table.internalProps.layoutMap;
|
|
41902
|
+
if (layout.isCornerHeader(cellGroup.col, cellGroup.row)) {
|
|
41903
|
+
hoverStyle = table.theme.cornerHeaderStyle?.hover;
|
|
41904
|
+
}
|
|
41905
|
+
else if (layout.isColumnHeader(cellGroup.col, cellGroup.row)) {
|
|
41906
|
+
hoverStyle = table.theme.headerStyle?.hover;
|
|
41907
|
+
}
|
|
41908
|
+
else if (layout.isRowHeader(cellGroup.col, cellGroup.row)) {
|
|
41909
|
+
hoverStyle = table.theme.rowHeaderStyle?.hover;
|
|
41910
|
+
}
|
|
41911
|
+
else if (layout.isBottomFrozenRow(cellGroup.col, cellGroup.row)) {
|
|
41912
|
+
hoverStyle = table.theme.bottomFrozenStyle?.hover || table.theme.headerStyle?.hover;
|
|
41913
|
+
}
|
|
41914
|
+
else if (layout.isRightFrozenColumn(cellGroup.col, cellGroup.row)) {
|
|
41915
|
+
hoverStyle = table.theme.rightFrozenStyle?.hover || table.theme.rowHeaderStyle?.hover;
|
|
41916
|
+
}
|
|
41917
|
+
else if (!table.isHeader(cellGroup.col, cellGroup.row)) {
|
|
41918
|
+
hoverStyle = table.theme.bodyStyle?.hover;
|
|
41919
|
+
}
|
|
41901
41920
|
const fillColor = getProp(colorKey, hoverStyle, cellGroup.col, cellGroup.row, table);
|
|
41902
41921
|
return fillColor;
|
|
41903
41922
|
}
|
|
@@ -43361,6 +43380,9 @@
|
|
|
43361
43380
|
if (cellTheme.text.textBaseline) {
|
|
43362
43381
|
textBaseline = cellTheme.text.textBaseline;
|
|
43363
43382
|
}
|
|
43383
|
+
if (cellType !== 'body' && !cellTheme.group.fill) {
|
|
43384
|
+
cellTheme.group.fill = '#fff';
|
|
43385
|
+
}
|
|
43364
43386
|
let cellWidth = colWidth;
|
|
43365
43387
|
let cellHeight = table.getRowHeight(row);
|
|
43366
43388
|
const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||
|
|
@@ -43557,33 +43579,20 @@
|
|
|
43557
43579
|
else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {
|
|
43558
43580
|
count = proxy.colStart - proxy.bodyLeftCol;
|
|
43559
43581
|
}
|
|
43560
|
-
|
|
43582
|
+
proxy.table.scenegraph.bodyGroup;
|
|
43561
43583
|
if (count < proxy.colEnd - proxy.colStart) {
|
|
43562
43584
|
const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;
|
|
43563
43585
|
const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;
|
|
43564
43586
|
const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;
|
|
43565
43587
|
const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;
|
|
43566
43588
|
computeColsWidth(proxy.table, distStartCol, distEndCol);
|
|
43567
|
-
|
|
43568
|
-
if (direction === 'left') {
|
|
43569
|
-
const colGroup = bodyGroup.firstChild;
|
|
43570
|
-
updateColGroupPosition(colGroup, bodyGroup.lastChild.col + 1, bodyGroup.lastChild.attribute.x + bodyGroup.lastChild.attribute.width);
|
|
43571
|
-
bodyGroup.appendChild(colGroup);
|
|
43572
|
-
}
|
|
43573
|
-
else {
|
|
43574
|
-
const colGroup = bodyGroup.lastChild;
|
|
43575
|
-
updateColGroupPosition(colGroup, bodyGroup.firstChild.col - 1, bodyGroup.firstChild.attribute.x - proxy.table.getColWidth(bodyGroup.firstChild.col - 1));
|
|
43576
|
-
bodyGroup.insertBefore(colGroup, bodyGroup.firstChild);
|
|
43577
|
-
}
|
|
43578
|
-
}
|
|
43589
|
+
updatePartColPosition(startCol, endCol, direction, proxy);
|
|
43579
43590
|
const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenColCount * 1);
|
|
43580
43591
|
const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenColCount * 2);
|
|
43581
|
-
for (let col = syncLeftCol; col <= syncRightCol; col++) {
|
|
43582
|
-
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43583
|
-
updateColGroupContent(colGroup, proxy);
|
|
43584
|
-
}
|
|
43585
43592
|
proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;
|
|
43586
43593
|
proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
|
|
43594
|
+
checkFirstColMerge(distStartCol, proxy);
|
|
43595
|
+
updateColContent(syncLeftCol, syncRightCol, proxy);
|
|
43587
43596
|
proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
|
|
43588
43597
|
proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
|
|
43589
43598
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
|
|
@@ -43598,24 +43607,13 @@
|
|
|
43598
43607
|
computeColsWidth(proxy.table, distStartCol, distEndCol);
|
|
43599
43608
|
const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);
|
|
43600
43609
|
console.log('distStartColY', proxy.bodyLeftCol, distStartCol - 1, distStartColY);
|
|
43601
|
-
|
|
43602
|
-
if (colGroup.type === 'group') {
|
|
43603
|
-
updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
|
|
43604
|
-
? distStartColY
|
|
43605
|
-
: colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
|
|
43606
|
-
}
|
|
43607
|
-
});
|
|
43610
|
+
updateAllColPosition(distStartColY, count, direction, proxy);
|
|
43608
43611
|
const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenRowCount * 1);
|
|
43609
43612
|
const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenRowCount * 2);
|
|
43610
|
-
for (let col = syncLeftCol; col <= syncRightCol; col++) {
|
|
43611
|
-
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43612
|
-
updateColGroupContent(colGroup, proxy);
|
|
43613
|
-
}
|
|
43614
|
-
const cellGroup = proxy.table.scenegraph.getCell(screenLeftCol, 0);
|
|
43615
|
-
cellGroup.AABBBounds.width();
|
|
43616
|
-
console.log('leftCell', cellGroup.col, cellGroup.globalAABBBounds, cellGroup);
|
|
43617
43613
|
proxy.colStart = distStartCol;
|
|
43618
43614
|
proxy.colEnd = distEndCol;
|
|
43615
|
+
checkFirstColMerge(distStartCol, proxy);
|
|
43616
|
+
updateColContent(syncLeftCol, syncRightCol, proxy);
|
|
43619
43617
|
proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
|
|
43620
43618
|
proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
|
|
43621
43619
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
|
|
@@ -43641,6 +43639,88 @@
|
|
|
43641
43639
|
}
|
|
43642
43640
|
colGroup.needUpdate = false;
|
|
43643
43641
|
}
|
|
43642
|
+
function updatePartColPosition(startCol, endCol, direction, proxy) {
|
|
43643
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
43644
|
+
if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {
|
|
43645
|
+
updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
|
|
43646
|
+
}
|
|
43647
|
+
if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {
|
|
43648
|
+
updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
|
|
43649
|
+
}
|
|
43650
|
+
if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {
|
|
43651
|
+
updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
|
|
43652
|
+
}
|
|
43653
|
+
}
|
|
43654
|
+
}
|
|
43655
|
+
function updateColPosition(containerGroup, direction, proxy) {
|
|
43656
|
+
if (direction === 'left') {
|
|
43657
|
+
const colGroup = containerGroup.firstChild;
|
|
43658
|
+
updateColGroupPosition(colGroup, containerGroup.lastChild.col + 1, containerGroup.lastChild.attribute.x + containerGroup.lastChild.attribute.width);
|
|
43659
|
+
containerGroup.appendChild(colGroup);
|
|
43660
|
+
}
|
|
43661
|
+
else {
|
|
43662
|
+
const colGroup = containerGroup.lastChild;
|
|
43663
|
+
updateColGroupPosition(colGroup, containerGroup.firstChild.col - 1, containerGroup.firstChild.attribute.x -
|
|
43664
|
+
proxy.table.getColWidth(containerGroup.firstChild.col - 1));
|
|
43665
|
+
containerGroup.insertBefore(colGroup, containerGroup.firstChild);
|
|
43666
|
+
}
|
|
43667
|
+
}
|
|
43668
|
+
function updateColContent(syncLeftCol, syncRightCol, proxy) {
|
|
43669
|
+
for (let col = syncLeftCol; col <= syncRightCol; col++) {
|
|
43670
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43671
|
+
updateColGroupContent(colGroup, proxy);
|
|
43672
|
+
const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);
|
|
43673
|
+
updateColGroupContent(colHeaderColGroup, proxy);
|
|
43674
|
+
const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);
|
|
43675
|
+
updateColGroupContent(bottomColGroup, proxy);
|
|
43676
|
+
}
|
|
43677
|
+
}
|
|
43678
|
+
function updateAllColPosition(distStartColY, count, direction, proxy) {
|
|
43679
|
+
proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup, index) => {
|
|
43680
|
+
if (colGroup.type === 'group') {
|
|
43681
|
+
updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
|
|
43682
|
+
? distStartColY
|
|
43683
|
+
: colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
|
|
43684
|
+
}
|
|
43685
|
+
});
|
|
43686
|
+
proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup, index) => {
|
|
43687
|
+
if (colGroup.type === 'group') {
|
|
43688
|
+
updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
|
|
43689
|
+
? distStartColY
|
|
43690
|
+
: colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
|
|
43691
|
+
}
|
|
43692
|
+
});
|
|
43693
|
+
proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup, index) => {
|
|
43694
|
+
if (colGroup.type === 'group') {
|
|
43695
|
+
updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
|
|
43696
|
+
? distStartColY
|
|
43697
|
+
: colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
|
|
43698
|
+
}
|
|
43699
|
+
});
|
|
43700
|
+
}
|
|
43701
|
+
function checkFirstColMerge(col, proxy) {
|
|
43702
|
+
for (let row = 0; row < proxy.table.rowCount; row++) {
|
|
43703
|
+
if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
|
|
43704
|
+
(row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
|
|
43705
|
+
continue;
|
|
43706
|
+
}
|
|
43707
|
+
const range = getCellMergeInfo(proxy.table, col, row);
|
|
43708
|
+
if (range && range.start.row !== row) {
|
|
43709
|
+
const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
|
|
43710
|
+
const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
|
|
43711
|
+
newCellGroup.col = col;
|
|
43712
|
+
newCellGroup.row = row;
|
|
43713
|
+
newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1));
|
|
43714
|
+
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
|
|
43715
|
+
oldCellGroup.parent.removeChild(oldCellGroup);
|
|
43716
|
+
oldCellGroup.needUpdate = false;
|
|
43717
|
+
newCellGroup.needUpdate = false;
|
|
43718
|
+
if (proxy.cellCache.get(col)) {
|
|
43719
|
+
proxy.cellCache.set(col, newCellGroup);
|
|
43720
|
+
}
|
|
43721
|
+
}
|
|
43722
|
+
}
|
|
43723
|
+
}
|
|
43644
43724
|
|
|
43645
43725
|
function updateAutoRow(colStart, colEnd, rowStart, rowEnd, table, direction = 'up') {
|
|
43646
43726
|
if (direction === 'up') {
|
|
@@ -43713,39 +43793,21 @@
|
|
|
43713
43793
|
if (count < proxy.rowEnd - proxy.rowStart) {
|
|
43714
43794
|
const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;
|
|
43715
43795
|
const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;
|
|
43716
|
-
|
|
43717
|
-
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43718
|
-
for (let row = startRow; row <= endRow; row++) {
|
|
43719
|
-
if (direction === 'up') {
|
|
43720
|
-
const cellGroup = colGroup.firstChild;
|
|
43721
|
-
proxy.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + colGroup.lastChild.attribute.height);
|
|
43722
|
-
colGroup.appendChild(cellGroup);
|
|
43723
|
-
}
|
|
43724
|
-
else {
|
|
43725
|
-
const cellGroup = colGroup.lastChild;
|
|
43726
|
-
proxy.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - cellGroup.attribute.height);
|
|
43727
|
-
colGroup.insertBefore(cellGroup, colGroup.firstChild);
|
|
43728
|
-
}
|
|
43729
|
-
}
|
|
43730
|
-
}
|
|
43796
|
+
updatePartRowPosition(startRow, endRow, direction, proxy);
|
|
43731
43797
|
const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;
|
|
43732
|
-
|
|
43798
|
+
direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;
|
|
43733
43799
|
const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
|
|
43734
43800
|
const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
|
|
43735
43801
|
if (proxy.table.heightMode === 'autoHeight') {
|
|
43736
43802
|
computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
|
|
43737
43803
|
}
|
|
43738
|
-
|
|
43739
|
-
|
|
43740
|
-
|
|
43741
|
-
|
|
43742
|
-
}
|
|
43743
|
-
}
|
|
43804
|
+
proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
|
|
43805
|
+
proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
|
|
43806
|
+
checkFirstRowMerge(distStartRow, proxy);
|
|
43807
|
+
updateRowContent(syncTopRow, syncBottomRow, proxy);
|
|
43744
43808
|
if (proxy.table.heightMode === 'autoHeight') {
|
|
43745
43809
|
updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, direction);
|
|
43746
43810
|
}
|
|
43747
|
-
proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
|
|
43748
|
-
proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
|
|
43749
43811
|
proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
|
|
43750
43812
|
proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;
|
|
43751
43813
|
proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
|
|
@@ -43760,14 +43822,7 @@
|
|
|
43760
43822
|
const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
|
|
43761
43823
|
const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
|
|
43762
43824
|
const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);
|
|
43763
|
-
|
|
43764
|
-
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43765
|
-
colGroup?.forEachChildren((cellGroup, index) => {
|
|
43766
|
-
proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
|
|
43767
|
-
? distStartRowY
|
|
43768
|
-
: cellGroup._prev.attribute.y + cellGroup._prev.attribute.height);
|
|
43769
|
-
});
|
|
43770
|
-
}
|
|
43825
|
+
updateAllRowPosition(distStartRowY, count, direction, proxy);
|
|
43771
43826
|
let syncTopRow;
|
|
43772
43827
|
let syncBottomRow;
|
|
43773
43828
|
if (proxy.table.heightMode === 'autoHeight') {
|
|
@@ -43784,12 +43839,8 @@
|
|
|
43784
43839
|
}
|
|
43785
43840
|
proxy.rowStart = distStartRow;
|
|
43786
43841
|
proxy.rowEnd = distEndRow;
|
|
43787
|
-
|
|
43788
|
-
|
|
43789
|
-
const cellGroup = proxy.highPerformanceGetCell(col, row, distStartRow, distEndRow);
|
|
43790
|
-
proxy.updateCellGroupContent(cellGroup);
|
|
43791
|
-
}
|
|
43792
|
-
}
|
|
43842
|
+
checkFirstRowMerge(distStartRow, proxy);
|
|
43843
|
+
updateRowContent(syncTopRow, syncBottomRow, proxy);
|
|
43793
43844
|
console.log('updateAutoRow', distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
|
|
43794
43845
|
if (proxy.table.heightMode === 'autoHeight') {
|
|
43795
43846
|
updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
|
|
@@ -43807,6 +43858,107 @@
|
|
|
43807
43858
|
}
|
|
43808
43859
|
}
|
|
43809
43860
|
}
|
|
43861
|
+
function updatePartRowPosition(startRow, endRow, direction, proxy) {
|
|
43862
|
+
for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {
|
|
43863
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43864
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
43865
|
+
updateCellGroupPosition(colGroup, direction, proxy);
|
|
43866
|
+
}
|
|
43867
|
+
}
|
|
43868
|
+
for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
|
|
43869
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43870
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
43871
|
+
updateCellGroupPosition(colGroup, direction, proxy);
|
|
43872
|
+
}
|
|
43873
|
+
}
|
|
43874
|
+
for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
|
|
43875
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43876
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
43877
|
+
updateCellGroupPosition(colGroup, direction, proxy);
|
|
43878
|
+
}
|
|
43879
|
+
}
|
|
43880
|
+
}
|
|
43881
|
+
function updateCellGroupPosition(colGroup, direction, proxy) {
|
|
43882
|
+
if (direction === 'up') {
|
|
43883
|
+
const cellGroup = colGroup.firstChild;
|
|
43884
|
+
proxy.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + colGroup.lastChild.attribute.height);
|
|
43885
|
+
colGroup.appendChild(cellGroup);
|
|
43886
|
+
}
|
|
43887
|
+
else {
|
|
43888
|
+
const cellGroup = colGroup.lastChild;
|
|
43889
|
+
proxy.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - cellGroup.attribute.height);
|
|
43890
|
+
colGroup.insertBefore(cellGroup, colGroup.firstChild);
|
|
43891
|
+
}
|
|
43892
|
+
}
|
|
43893
|
+
function updateAllRowPosition(distStartRowY, count, direction, proxy) {
|
|
43894
|
+
for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {
|
|
43895
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43896
|
+
colGroup?.forEachChildren((cellGroup, index) => {
|
|
43897
|
+
proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
|
|
43898
|
+
? distStartRowY
|
|
43899
|
+
: cellGroup._prev.attribute.y + proxy.table.getRowHeight(cellGroup._prev.row));
|
|
43900
|
+
});
|
|
43901
|
+
}
|
|
43902
|
+
for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
|
|
43903
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43904
|
+
colGroup?.forEachChildren((cellGroup, index) => {
|
|
43905
|
+
proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
|
|
43906
|
+
? distStartRowY
|
|
43907
|
+
: cellGroup._prev.attribute.y + proxy.table.getRowHeight(cellGroup._prev.row));
|
|
43908
|
+
});
|
|
43909
|
+
}
|
|
43910
|
+
for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
|
|
43911
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
43912
|
+
colGroup?.forEachChildren((cellGroup, index) => {
|
|
43913
|
+
proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
|
|
43914
|
+
? distStartRowY
|
|
43915
|
+
: cellGroup._prev.attribute.y + proxy.table.getRowHeight(cellGroup._prev.row));
|
|
43916
|
+
});
|
|
43917
|
+
}
|
|
43918
|
+
}
|
|
43919
|
+
function updateRowContent(syncTopRow, syncBottomRow, proxy) {
|
|
43920
|
+
for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {
|
|
43921
|
+
for (let row = syncTopRow; row <= syncBottomRow; row++) {
|
|
43922
|
+
const cellGroup = proxy.highPerformanceGetCell(col, row, true);
|
|
43923
|
+
proxy.updateCellGroupContent(cellGroup);
|
|
43924
|
+
}
|
|
43925
|
+
}
|
|
43926
|
+
for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
|
|
43927
|
+
for (let row = syncTopRow; row <= syncBottomRow; row++) {
|
|
43928
|
+
const cellGroup = proxy.highPerformanceGetCell(col, row);
|
|
43929
|
+
proxy.updateCellGroupContent(cellGroup);
|
|
43930
|
+
}
|
|
43931
|
+
}
|
|
43932
|
+
for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
|
|
43933
|
+
for (let row = syncTopRow; row <= syncBottomRow; row++) {
|
|
43934
|
+
const cellGroup = proxy.highPerformanceGetCell(col, row);
|
|
43935
|
+
proxy.updateCellGroupContent(cellGroup);
|
|
43936
|
+
}
|
|
43937
|
+
}
|
|
43938
|
+
}
|
|
43939
|
+
function checkFirstRowMerge(row, proxy) {
|
|
43940
|
+
for (let col = 0; col < proxy.table.colCount; col++) {
|
|
43941
|
+
if ((col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||
|
|
43942
|
+
(col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)) {
|
|
43943
|
+
continue;
|
|
43944
|
+
}
|
|
43945
|
+
const range = getCellMergeInfo(proxy.table, col, row);
|
|
43946
|
+
if (range && range.start.row !== row) {
|
|
43947
|
+
const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
|
|
43948
|
+
const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
|
|
43949
|
+
newCellGroup.col = col;
|
|
43950
|
+
newCellGroup.row = row;
|
|
43951
|
+
newCellGroup.setAttribute('y', proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1));
|
|
43952
|
+
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
|
|
43953
|
+
oldCellGroup.parent.removeChild(oldCellGroup);
|
|
43954
|
+
oldCellGroup.needUpdate = false;
|
|
43955
|
+
newCellGroup.needUpdate = false;
|
|
43956
|
+
if (proxy.cellCache.get(col)) {
|
|
43957
|
+
proxy.cellCache.set(col, newCellGroup);
|
|
43958
|
+
}
|
|
43959
|
+
}
|
|
43960
|
+
}
|
|
43961
|
+
}
|
|
43810
43962
|
|
|
43811
43963
|
class SceneProxy {
|
|
43812
43964
|
table;
|
|
@@ -43991,6 +44143,22 @@
|
|
|
43991
44143
|
createColGroup(onceCount) {
|
|
43992
44144
|
const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
|
|
43993
44145
|
computeColsWidth(this.table, this.currentCol + 1, endCol);
|
|
44146
|
+
if (this.table.columnHeaderLevelCount) {
|
|
44147
|
+
const lastColumnGroup = (this.table.scenegraph.colHeaderGroup.lastChild instanceof Group
|
|
44148
|
+
? this.table.scenegraph.colHeaderGroup.lastChild
|
|
44149
|
+
: this.table.scenegraph.colHeaderGroup.lastChild._prev);
|
|
44150
|
+
const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;
|
|
44151
|
+
const yOrigin = lastColumnGroup.attribute.y;
|
|
44152
|
+
createColGroup(this.table.scenegraph.colHeaderGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, 0, this.table.columnHeaderLevelCount - 1, 'columnHeader', this.table);
|
|
44153
|
+
}
|
|
44154
|
+
if (this.table.bottomFrozenRowCount) {
|
|
44155
|
+
const lastColumnGroup = (this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group
|
|
44156
|
+
? this.table.scenegraph.bottomFrozenGroup.lastChild
|
|
44157
|
+
: this.table.scenegraph.bottomFrozenGroup.lastChild._prev);
|
|
44158
|
+
const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;
|
|
44159
|
+
const yOrigin = lastColumnGroup.attribute.y;
|
|
44160
|
+
createColGroup(this.table.scenegraph.bottomFrozenGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, this.table.rowCount - this.table.bottomFrozenRowCount, this.table.rowCount - 1, 'columnHeader', this.table);
|
|
44161
|
+
}
|
|
43994
44162
|
const lastColumnGroup = (this.table.scenegraph.bodyGroup.lastChild instanceof Group
|
|
43995
44163
|
? this.table.scenegraph.bodyGroup.lastChild
|
|
43996
44164
|
: this.table.scenegraph.bodyGroup.lastChild._prev);
|
|
@@ -44044,12 +44212,7 @@
|
|
|
44044
44212
|
if (this.table.heightMode === 'autoHeight') {
|
|
44045
44213
|
computeRowsHeight(this.table, this.rowUpdatePos, distRow);
|
|
44046
44214
|
}
|
|
44047
|
-
|
|
44048
|
-
for (let row = this.rowUpdatePos; row <= distRow; row++) {
|
|
44049
|
-
const cellGroup = this.highPerformanceGetCell(col, row);
|
|
44050
|
-
this.updateCellGroupContent(cellGroup);
|
|
44051
|
-
}
|
|
44052
|
-
}
|
|
44215
|
+
updateRowContent(this.rowUpdatePos, distRow, this);
|
|
44053
44216
|
if (this.table.heightMode === 'autoHeight') {
|
|
44054
44217
|
updateAutoRow(this.bodyLeftCol, this.bodyRightCol, this.rowUpdatePos, distRow, this.table, this.rowUpdateDirection);
|
|
44055
44218
|
}
|
|
@@ -44060,17 +44223,8 @@
|
|
|
44060
44223
|
}
|
|
44061
44224
|
updateColGroups(count) {
|
|
44062
44225
|
const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);
|
|
44063
|
-
|
|
44064
|
-
|
|
44065
|
-
if (colGroup) {
|
|
44066
|
-
let cellGroup = colGroup.firstChild;
|
|
44067
|
-
while (cellGroup) {
|
|
44068
|
-
const newCellGroup = this.updateCellGroupContent(cellGroup);
|
|
44069
|
-
cellGroup = newCellGroup._next;
|
|
44070
|
-
}
|
|
44071
|
-
colGroup.needUpdate = false;
|
|
44072
|
-
}
|
|
44073
|
-
}
|
|
44226
|
+
computeColsWidth(this.table, this.colUpdatePos, distCol);
|
|
44227
|
+
updateColContent(this.colUpdatePos, distCol, this);
|
|
44074
44228
|
this.colUpdatePos = distCol + 1;
|
|
44075
44229
|
}
|
|
44076
44230
|
updateCellGroupPosition(cellGroup, newRow, y) {
|
|
@@ -44134,18 +44288,22 @@
|
|
|
44134
44288
|
await this.progress();
|
|
44135
44289
|
}
|
|
44136
44290
|
}
|
|
44137
|
-
highPerformanceGetCell(col, row,
|
|
44138
|
-
if (row
|
|
44291
|
+
highPerformanceGetCell(col, row, getShadow) {
|
|
44292
|
+
if (row >= this.table.columnHeaderLevelCount &&
|
|
44293
|
+
row < this.table.rowCount - this.table.bottomFrozenRowCount &&
|
|
44294
|
+
(row < this.rowStart || row > this.rowEnd)) {
|
|
44139
44295
|
return emptyGroup;
|
|
44140
44296
|
}
|
|
44141
|
-
if (
|
|
44297
|
+
if (col >= this.table.rowHeaderLevelCount &&
|
|
44298
|
+
col < this.table.colCount - this.table.rightFrozenColCount &&
|
|
44299
|
+
(col < this.colStart || col > this.colEnd)) {
|
|
44142
44300
|
return emptyGroup;
|
|
44143
44301
|
}
|
|
44144
44302
|
if (this.cellCache.get(col)) {
|
|
44145
44303
|
const cacheCellGoup = this.cellCache.get(col);
|
|
44146
44304
|
if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {
|
|
44147
44305
|
let cellGroup = getCellByCache(cacheCellGoup, row);
|
|
44148
|
-
if (!cellGroup) {
|
|
44306
|
+
if (!cellGroup || (!getShadow && cellGroup.role === 'shadow-cell')) {
|
|
44149
44307
|
cellGroup = this.table.scenegraph.getCell(col, row, getShadow);
|
|
44150
44308
|
}
|
|
44151
44309
|
cellGroup.row && this.cellCache.set(col, cellGroup);
|
|
@@ -45326,10 +45484,7 @@
|
|
|
45326
45484
|
return cell || emptyGroup;
|
|
45327
45485
|
}
|
|
45328
45486
|
highPerformanceGetCell(col, row, getShadow) {
|
|
45329
|
-
|
|
45330
|
-
return this.proxy.highPerformanceGetCell(col, row, 0, this.table.rowCount - 1, getShadow);
|
|
45331
|
-
}
|
|
45332
|
-
return this.getCell(col, row, getShadow);
|
|
45487
|
+
return this.proxy.highPerformanceGetCell(col, row, getShadow);
|
|
45333
45488
|
}
|
|
45334
45489
|
getColGroup(col, isCornerOrColHeader = false) {
|
|
45335
45490
|
let element;
|
|
@@ -45841,6 +45996,7 @@
|
|
|
45841
45996
|
this.rowHeaderGroup.setDeltaWidth(rowHeaderX - this.rowHeaderGroup.attribute.width);
|
|
45842
45997
|
this.bodyGroup.setDeltaWidth(bodyX - this.bodyGroup.attribute.width);
|
|
45843
45998
|
this.colHeaderGroup.setAttribute('x', this.cornerHeaderGroup.attribute.width);
|
|
45999
|
+
this.bottomFrozenGroup.setAttribute('x', this.rowHeaderGroup.attribute.width);
|
|
45844
46000
|
this.bodyGroup.setAttribute('x', this.rowHeaderGroup.attribute.width);
|
|
45845
46001
|
this.updateTableSize();
|
|
45846
46002
|
const oldHorizontalBarPos = this.table.stateManeger.scroll.horizontalBarPos;
|
|
@@ -51158,7 +51314,7 @@
|
|
|
51158
51314
|
return TABLE_EVENT_TYPE;
|
|
51159
51315
|
}
|
|
51160
51316
|
options;
|
|
51161
|
-
version = "0.9.3-alpha.
|
|
51317
|
+
version = "0.9.3-alpha.2";
|
|
51162
51318
|
pagerConf;
|
|
51163
51319
|
id = `VTable${Date.now()}`;
|
|
51164
51320
|
headerStyleCache;
|
|
@@ -53344,6 +53500,9 @@
|
|
|
53344
53500
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
|
|
53345
53501
|
const colIndex = layout.getRecordIndexByCol(col);
|
|
53346
53502
|
indicatorKeys.forEach((key, index) => {
|
|
53503
|
+
if (isArray$3(key)) {
|
|
53504
|
+
key = key[0];
|
|
53505
|
+
}
|
|
53347
53506
|
const data = layout.dataset.collectedValues[key + '_align']
|
|
53348
53507
|
? layout.dataset.collectedValues[key + '_align']
|
|
53349
53508
|
: layout.dataset.collectedValues[key];
|
|
@@ -53360,7 +53519,10 @@
|
|
|
53360
53519
|
seriesIndex: index
|
|
53361
53520
|
}));
|
|
53362
53521
|
});
|
|
53363
|
-
|
|
53522
|
+
let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, col)[0];
|
|
53523
|
+
if (isArray$3(rowDimensionKey)) {
|
|
53524
|
+
rowDimensionKey = rowDimensionKey[0];
|
|
53525
|
+
}
|
|
53364
53526
|
const data = layout.dataset.cacheCollectedValues[rowDimensionKey] || layout.dataset.collectedValues[rowDimensionKey];
|
|
53365
53527
|
const recordRow = layout.getRecordIndexByRow(row);
|
|
53366
53528
|
const rowPath = layout.getRowKeysPath()[recordRow];
|
|
@@ -53384,6 +53546,9 @@
|
|
|
53384
53546
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
|
|
53385
53547
|
const rowIndex = layout.getRecordIndexByRow(row);
|
|
53386
53548
|
indicatorKeys.forEach((key, index) => {
|
|
53549
|
+
if (isArray$3(key)) {
|
|
53550
|
+
key = key[0];
|
|
53551
|
+
}
|
|
53387
53552
|
const data = layout.dataset.collectedValues[key + '_align']
|
|
53388
53553
|
? layout.dataset.collectedValues[key + '_align']
|
|
53389
53554
|
: layout.dataset.collectedValues[key];
|
|
@@ -53400,7 +53565,10 @@
|
|
|
53400
53565
|
seriesIndex: index
|
|
53401
53566
|
}));
|
|
53402
53567
|
});
|
|
53403
|
-
|
|
53568
|
+
let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
|
|
53569
|
+
if (isArray$3(columnDimensionKey)) {
|
|
53570
|
+
columnDimensionKey = columnDimensionKey[0];
|
|
53571
|
+
}
|
|
53404
53572
|
const data = layout.dataset.cacheCollectedValues[columnDimensionKey] || layout.dataset.collectedValues[columnDimensionKey];
|
|
53405
53573
|
const recordCol = layout.getRecordIndexByCol(col);
|
|
53406
53574
|
const colPath = layout.getColKeysPath()[recordCol];
|
|
@@ -56006,7 +56174,10 @@
|
|
|
56006
56174
|
col >= layout.rowHeaderLevelCount &&
|
|
56007
56175
|
col < layout.colCount - layout.rightFrozenColCount) {
|
|
56008
56176
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, layout.columnHeaderLevelCount - 1);
|
|
56009
|
-
|
|
56177
|
+
let defaultKey = indicatorKeys[1];
|
|
56178
|
+
if (isArray$3(defaultKey)) {
|
|
56179
|
+
defaultKey = defaultKey[0];
|
|
56180
|
+
}
|
|
56010
56181
|
if (!defaultKey) {
|
|
56011
56182
|
return undefined;
|
|
56012
56183
|
}
|
|
@@ -56037,7 +56208,10 @@
|
|
|
56037
56208
|
col >= layout.rowHeaderLevelCount &&
|
|
56038
56209
|
col < layout.colCount - layout.rightFrozenColCount) {
|
|
56039
56210
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
|
|
56040
|
-
|
|
56211
|
+
let defaultKey = indicatorKeys[0];
|
|
56212
|
+
if (isArray$3(defaultKey)) {
|
|
56213
|
+
defaultKey = defaultKey[0];
|
|
56214
|
+
}
|
|
56041
56215
|
const data = layout.dataset.collectedValues[defaultKey + '_align']
|
|
56042
56216
|
? layout.dataset.collectedValues[defaultKey + '_align']
|
|
56043
56217
|
: layout.dataset.collectedValues[defaultKey];
|
|
@@ -56072,7 +56246,10 @@
|
|
|
56072
56246
|
else if (col === layout.rowHeaderLevelCount - 1 &&
|
|
56073
56247
|
row >= layout.rowHeaderLevelCount &&
|
|
56074
56248
|
row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
56075
|
-
|
|
56249
|
+
let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)[0];
|
|
56250
|
+
if (isArray$3(rowDimensionKey)) {
|
|
56251
|
+
rowDimensionKey = rowDimensionKey[0];
|
|
56252
|
+
}
|
|
56076
56253
|
const data = layout.dataset.collectedValues[rowDimensionKey];
|
|
56077
56254
|
const recordRow = layout.getRecordIndexByRow(row);
|
|
56078
56255
|
const rowPath = layout.getRowKeysPath()[recordRow];
|
|
@@ -56098,7 +56275,10 @@
|
|
|
56098
56275
|
row >= layout.columnHeaderLevelCount &&
|
|
56099
56276
|
row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
56100
56277
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
|
|
56101
|
-
|
|
56278
|
+
let defaultKey = indicatorKeys[0];
|
|
56279
|
+
if (isArray$3(defaultKey)) {
|
|
56280
|
+
defaultKey = defaultKey[0];
|
|
56281
|
+
}
|
|
56102
56282
|
const data = layout.dataset.collectedValues[defaultKey + '_align']
|
|
56103
56283
|
? layout.dataset.collectedValues[defaultKey + '_align']
|
|
56104
56284
|
: layout.dataset.collectedValues[defaultKey];
|
|
@@ -56134,7 +56314,10 @@
|
|
|
56134
56314
|
row >= layout.columnHeaderLevelCount &&
|
|
56135
56315
|
row < layout.rowCount - layout.bottomFrozenRowCount) {
|
|
56136
56316
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(layout.rowHeaderLevelCount - 1, row);
|
|
56137
|
-
|
|
56317
|
+
let defaultKey = indicatorKeys[1];
|
|
56318
|
+
if (isArray$3(defaultKey)) {
|
|
56319
|
+
defaultKey = defaultKey[0];
|
|
56320
|
+
}
|
|
56138
56321
|
if (!defaultKey) {
|
|
56139
56322
|
return undefined;
|
|
56140
56323
|
}
|
|
@@ -56164,7 +56347,10 @@
|
|
|
56164
56347
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
56165
56348
|
col >= layout.rowHeaderLevelCount &&
|
|
56166
56349
|
col < layout.colCount - layout.rightFrozenColCount) {
|
|
56167
|
-
|
|
56350
|
+
let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
|
|
56351
|
+
if (isArray$3(columnDimensionKey)) {
|
|
56352
|
+
columnDimensionKey = columnDimensionKey[0];
|
|
56353
|
+
}
|
|
56168
56354
|
const data = layout.dataset.collectedValues[columnDimensionKey];
|
|
56169
56355
|
const recordCol = layout.getRecordIndexByCol(col);
|
|
56170
56356
|
const colPath = layout.getColKeysPath()[recordCol];
|
|
@@ -56231,8 +56417,10 @@
|
|
|
56231
56417
|
cornerSetting;
|
|
56232
56418
|
_table;
|
|
56233
56419
|
hasTwoIndicatorAxes;
|
|
56420
|
+
_chartItemSpanSize;
|
|
56234
56421
|
constructor(table, dataset) {
|
|
56235
56422
|
this._table = table;
|
|
56423
|
+
this._chartItemSpanSize = 0;
|
|
56236
56424
|
this.rowTree = table.options.rowTree;
|
|
56237
56425
|
this.columnTree = table.options.columnTree;
|
|
56238
56426
|
this.rowsDefine = table.options.rows ?? [];
|
|
@@ -56349,6 +56537,28 @@
|
|
|
56349
56537
|
}
|
|
56350
56538
|
return false;
|
|
56351
56539
|
});
|
|
56540
|
+
this._chartItemSpanSize = 0;
|
|
56541
|
+
this._indicatorObjects.find(indicatorObject => {
|
|
56542
|
+
if (indicatorObject.chartSpec?.barWidth) {
|
|
56543
|
+
this._chartItemSpanSize = indicatorObject.chartSpec?.barWidth;
|
|
56544
|
+
}
|
|
56545
|
+
if (this._chartItemSpanSize > 0) {
|
|
56546
|
+
return true;
|
|
56547
|
+
}
|
|
56548
|
+
indicatorObject.chartSpec.series?.find((seriesObject) => {
|
|
56549
|
+
if (seriesObject.barWidth) {
|
|
56550
|
+
this._chartItemSpanSize = seriesObject.barWidth;
|
|
56551
|
+
}
|
|
56552
|
+
if (this._chartItemSpanSize > 0) {
|
|
56553
|
+
return true;
|
|
56554
|
+
}
|
|
56555
|
+
return false;
|
|
56556
|
+
});
|
|
56557
|
+
if (this._chartItemSpanSize > 0) {
|
|
56558
|
+
return true;
|
|
56559
|
+
}
|
|
56560
|
+
return false;
|
|
56561
|
+
});
|
|
56352
56562
|
if (this.indicatorsAsCol) {
|
|
56353
56563
|
const cell_id = 'rowHeaderEmpty';
|
|
56354
56564
|
this._headerObjectMap[cell_id] = {
|
|
@@ -56547,7 +56757,7 @@
|
|
|
56547
56757
|
else if (this.cornerSetting.titleOnDimension === 'row') {
|
|
56548
56758
|
cornerAttrs = this.rowShowAttrs;
|
|
56549
56759
|
}
|
|
56550
|
-
cornerAttrs
|
|
56760
|
+
cornerAttrs?.forEach(cornerAttrStr => {
|
|
56551
56761
|
if (!this._headerObjectMap[cornerAttrStr]) {
|
|
56552
56762
|
const dimensionInfo = this.getDimensionInfo(cornerAttrStr);
|
|
56553
56763
|
this._headerObjectMap[cornerAttrStr] = {
|
|
@@ -57285,7 +57495,8 @@
|
|
|
57285
57495
|
break;
|
|
57286
57496
|
}
|
|
57287
57497
|
}
|
|
57288
|
-
|
|
57498
|
+
const barWidth = this._chartItemSpanSize || 25;
|
|
57499
|
+
return (collectedValues?.length ?? 0) * (barWidth + barWidth / 3);
|
|
57289
57500
|
}
|
|
57290
57501
|
getIndicatorKeyInChartSpec(_col, _row) {
|
|
57291
57502
|
const chartSpec = this.getRawChartSpec(_col, _row);
|
|
@@ -57322,10 +57533,10 @@
|
|
|
57322
57533
|
const dimensionKeys = [];
|
|
57323
57534
|
if (chartSpec) {
|
|
57324
57535
|
if (this.indicatorsAsCol === false) {
|
|
57325
|
-
dimensionKeys.push(chartSpec.xField);
|
|
57536
|
+
dimensionKeys.push(chartSpec.xField ?? chartSpec?.series[0]?.xField);
|
|
57326
57537
|
}
|
|
57327
57538
|
else {
|
|
57328
|
-
dimensionKeys.push(chartSpec.yField);
|
|
57539
|
+
dimensionKeys.push(chartSpec.yField ?? chartSpec?.series[0]?.yField);
|
|
57329
57540
|
}
|
|
57330
57541
|
return dimensionKeys;
|
|
57331
57542
|
}
|
|
@@ -58069,6 +58280,7 @@
|
|
|
58069
58280
|
const t0 = typeof window !== 'undefined' ? window.performance.now() : 0;
|
|
58070
58281
|
this.setRecords(records);
|
|
58071
58282
|
this.processCollectedValuesWithSumBy();
|
|
58283
|
+
this.processCollectedValuesWithSortBy();
|
|
58072
58284
|
const t1 = typeof window !== 'undefined' ? window.performance.now() : 0;
|
|
58073
58285
|
console.log('processRecords:', t1 - t0);
|
|
58074
58286
|
const t4 = typeof window !== 'undefined' ? window.performance.now() : 0;
|
|
@@ -58131,6 +58343,15 @@
|
|
|
58131
58343
|
}
|
|
58132
58344
|
}
|
|
58133
58345
|
}
|
|
58346
|
+
processCollectedValuesWithSortBy() {
|
|
58347
|
+
for (const field in this.collectedValues) {
|
|
58348
|
+
if (this.collectValuesBy[field]?.sortBy) {
|
|
58349
|
+
for (const byKeys in this.collectedValues[field]) {
|
|
58350
|
+
this.collectedValues[field][byKeys] = this.collectedValues[field][byKeys].sort((a, b) => this.collectValuesBy[field]?.sortBy.indexOf(a) - this.collectValuesBy[field]?.sortBy.indexOf(b));
|
|
58351
|
+
}
|
|
58352
|
+
}
|
|
58353
|
+
}
|
|
58354
|
+
}
|
|
58134
58355
|
processRecords() {
|
|
58135
58356
|
let isNeedFilter = false;
|
|
58136
58357
|
if (this.dataConfig?.filterRules?.length >= 1) {
|
|
@@ -58194,7 +58415,7 @@
|
|
|
58194
58415
|
};
|
|
58195
58416
|
}
|
|
58196
58417
|
else {
|
|
58197
|
-
this.collectedValues[field][collectKeys] =
|
|
58418
|
+
this.collectedValues[field][collectKeys] = [];
|
|
58198
58419
|
}
|
|
58199
58420
|
}
|
|
58200
58421
|
if (this.collectValuesBy[field].sumBy) {
|
|
@@ -58211,7 +58432,9 @@
|
|
|
58211
58432
|
}
|
|
58212
58433
|
else {
|
|
58213
58434
|
const fieldRange = this.collectedValues[field][collectKeys];
|
|
58214
|
-
fieldRange.
|
|
58435
|
+
if (fieldRange.indexOf(record[field]) === -1) {
|
|
58436
|
+
fieldRange.push(record[field]);
|
|
58437
|
+
}
|
|
58215
58438
|
}
|
|
58216
58439
|
}
|
|
58217
58440
|
}
|
|
@@ -59559,13 +59782,21 @@
|
|
|
59559
59782
|
collectValuesBy[xField] = {
|
|
59560
59783
|
by: columnKeys,
|
|
59561
59784
|
type: chartSeries.direction !== 'horizontal' ? 'xField' : undefined,
|
|
59562
|
-
range: chartSeries.direction === 'horizontal'
|
|
59785
|
+
range: chartSeries.direction === 'horizontal',
|
|
59786
|
+
sortBy: chartSeries.direction !== 'horizontal'
|
|
59787
|
+
? chartSeries?.data?.fields?.[xField]?.domain ??
|
|
59788
|
+
indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
59789
|
+
: undefined
|
|
59563
59790
|
};
|
|
59564
59791
|
const yField = chartSeries.yField;
|
|
59565
59792
|
collectValuesBy[yField] = {
|
|
59566
59793
|
by: rowKeys,
|
|
59567
59794
|
range: chartSeries.direction !== 'horizontal',
|
|
59568
|
-
sumBy: chartSeries.stack !== false && columnKeys.concat(xField)
|
|
59795
|
+
sumBy: chartSeries.stack !== false && columnKeys.concat(xField),
|
|
59796
|
+
sortBy: chartSeries.direction === 'horizontal'
|
|
59797
|
+
? chartSeries?.data?.fields?.[yField]?.domain ??
|
|
59798
|
+
indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
59799
|
+
: undefined
|
|
59569
59800
|
};
|
|
59570
59801
|
});
|
|
59571
59802
|
}
|
|
@@ -59576,13 +59807,19 @@
|
|
|
59576
59807
|
collectValuesBy[xField] = {
|
|
59577
59808
|
by: columnKeys,
|
|
59578
59809
|
type: indicatorDefine.chartSpec.direction !== 'horizontal' ? 'xField' : undefined,
|
|
59579
|
-
range: indicatorDefine.chartSpec.direction === 'horizontal'
|
|
59810
|
+
range: indicatorDefine.chartSpec.direction === 'horizontal',
|
|
59811
|
+
sortBy: indicatorDefine.chartSpec.direction !== 'horizontal'
|
|
59812
|
+
? indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
59813
|
+
: undefined
|
|
59580
59814
|
};
|
|
59581
59815
|
const yField = indicatorDefine.chartSpec.yField;
|
|
59582
59816
|
collectValuesBy[yField] = {
|
|
59583
59817
|
by: rowKeys,
|
|
59584
59818
|
range: option.indicators[i].chartSpec.direction !== 'horizontal',
|
|
59585
|
-
sumBy: indicatorDefine.chartSpec.stack !== false && columnKeys.concat(xField)
|
|
59819
|
+
sumBy: indicatorDefine.chartSpec.stack !== false && columnKeys.concat(xField),
|
|
59820
|
+
sortBy: indicatorDefine.chartSpec.direction === 'horizontal'
|
|
59821
|
+
? indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
59822
|
+
: undefined
|
|
59586
59823
|
};
|
|
59587
59824
|
}
|
|
59588
59825
|
}
|
|
@@ -59600,13 +59837,21 @@
|
|
|
59600
59837
|
collectValuesBy[yField] = {
|
|
59601
59838
|
by: rowKeys,
|
|
59602
59839
|
type: chartSeries.direction === 'horizontal' ? 'yField' : undefined,
|
|
59603
|
-
range: chartSeries.direction !== 'horizontal'
|
|
59840
|
+
range: chartSeries.direction !== 'horizontal',
|
|
59841
|
+
sortBy: chartSeries.direction === 'horizontal'
|
|
59842
|
+
? chartSeries?.data?.fields?.[yField]?.domain ??
|
|
59843
|
+
indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
59844
|
+
: undefined
|
|
59604
59845
|
};
|
|
59605
59846
|
const xField = chartSeries.xField;
|
|
59606
59847
|
collectValuesBy[xField] = {
|
|
59607
59848
|
by: columnKeys,
|
|
59608
59849
|
range: chartSeries.direction === 'horizontal',
|
|
59609
|
-
sumBy: chartSeries.stack !== false && rowKeys.concat(yField)
|
|
59850
|
+
sumBy: chartSeries.stack !== false && rowKeys.concat(yField),
|
|
59851
|
+
sortBy: chartSeries.direction !== 'horizontal'
|
|
59852
|
+
? chartSeries?.data?.fields?.[xField]?.domain ??
|
|
59853
|
+
indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
59854
|
+
: undefined
|
|
59610
59855
|
};
|
|
59611
59856
|
});
|
|
59612
59857
|
}
|
|
@@ -59617,13 +59862,19 @@
|
|
|
59617
59862
|
collectValuesBy[yField] = {
|
|
59618
59863
|
by: rowKeys,
|
|
59619
59864
|
type: indicatorDefine.chartSpec.direction === 'horizontal' ? 'yField' : undefined,
|
|
59620
|
-
range: indicatorDefine.chartSpec.direction !== 'horizontal'
|
|
59865
|
+
range: indicatorDefine.chartSpec.direction !== 'horizontal',
|
|
59866
|
+
sortBy: indicatorDefine.chartSpec.direction === 'horizontal'
|
|
59867
|
+
? indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
59868
|
+
: undefined
|
|
59621
59869
|
};
|
|
59622
59870
|
const xField = indicatorDefine.chartSpec.xField;
|
|
59623
59871
|
collectValuesBy[xField] = {
|
|
59624
59872
|
by: columnKeys,
|
|
59625
59873
|
range: option.indicators[i].chartSpec.direction === 'horizontal',
|
|
59626
|
-
sumBy: indicatorDefine.chartSpec.stack !== false && rowKeys.concat(yField)
|
|
59874
|
+
sumBy: indicatorDefine.chartSpec.stack !== false && rowKeys.concat(yField),
|
|
59875
|
+
sortBy: indicatorDefine.chartSpec.direction !== 'horizontal'
|
|
59876
|
+
? indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
59877
|
+
: undefined
|
|
59627
59878
|
};
|
|
59628
59879
|
}
|
|
59629
59880
|
}
|
|
@@ -60403,7 +60654,7 @@
|
|
|
60403
60654
|
percentCalc: percentCalc
|
|
60404
60655
|
});
|
|
60405
60656
|
|
|
60406
|
-
const version = "0.9.3-alpha.
|
|
60657
|
+
const version = "0.9.3-alpha.2";
|
|
60407
60658
|
function getIcons() {
|
|
60408
60659
|
return get$1();
|
|
60409
60660
|
}
|