[Feature] 透视表性能差,8000条数据就卡
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- performance
Direzione di ricerca
Inizia con il file testdata.ts allegato e con la configurazione VTable.PivotTable incorporata, quindi confronta il suo comportamento con l’esempio DevExtreme che utilizza lo scorrimento virtuale. Analizza il rallentamento intorno agli 8.000 record e definisci il completamento come un miglioramento misurabile della reattività per la configurazione di tabella pivot fornita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What problem does this feature solve?
可以的话,还请优化一下
https://applink.feishu.cn/client/message/link/open?token=AmU%2FQqHXB0ADaYFiXOBBDtw%3D
测试数据
testdata.ts
性能对比
vtable
https://github.com/user-attachments/assets/280da75b-1804-4cfc-a713-dbd9b485db9b
DevExtreme
开启虚拟渲染
https://github.com/user-attachments/assets/3e13a790-bd27-43cf-89cd-87fbf7b99cea
测试数据
testdata.ts
vtable代码
<script setup lang="ts">
import { onMounted } from 'vue'
import data from './testdata'
import * as VTable from '@visactor/vtable'
import { InputEditor } from '@visactor/vtable-editors'
const VTag = VTable.VTag
const input_editor = new InputEditor({})
VTable.register.editor('input-editor', input_editor)
function statusCellRender(args) {
const { value, rect, data } = args
const isOpen = value === 'Open'
const bgColor = isOpen ? '#FFF3E0' : '#E8F5E9'
const textColor = isOpen ? '#FB8C00' : '#2E7D32'
return {
type: 'group',
pickable: true,
cursor: 'pointer',
children: [
{
type: 'rect',
x: 6,
y: 6,
width: rect.width - 12,
height: rect.height - 12,
fill: bgColor,
radius: 6,
},
{
type: 'text',
text: value,
x: rect.width / 2,
y: rect.height / 2,
textAlign: 'center',
textBaseline: 'middle',
fill: textColor,
fontWeight: 'bold',
},
],
onClick: () => {
console.log('点击 Status', data)
},
}
}
onMounted(() => {
const table = new VTable.PivotTable({
theme: { scrollStyle: {
width: 10,
visible: 'always',
},},
container: document.getElementById('container'),
records: data,
rowHierarchyType: 'grid-tree',
corner: { titleOnDimension: 'row', },
rowExpandLevel:5,
rows: [
{
dimensionKey: 'channel',
title: 'channel',
hide: false,
maxWidth: 450,
showSubTotal: true,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
{
dimensionKey: 'city',
title: 'city',
hide: false,
maxWidth: 450,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
{
dimensionKey: 'store',
title: 'store',
hide: false,
maxWidth: 450,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
{
dimensionKey: 'product_category',
title: 'product_category',
hide: false,
maxWidth: 450,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
{
dimensionKey: 'sku',
title: 'sku',
hide: false,
maxWidth: 450,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
],
columns: [
{
dimensionKey: 'year_co',
title: 'year',
hide: false,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
{
dimensionKey: 'year_mth',
title: 'month',
hide: false,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
{
dimensionKey: 'day_of_month',
title: 'day',
hide: false,
showSubTotal: false,
headerStyle: { textStick: true },
width: 'auto',
oibpType: 'string',
},
],
indicators: [
{
indicatorKey: 'original_value',
title: 'original_value',
maxWidth: 300,
hide: false,
oibpFilterStyles: [],
oibpType: 'number',
oibpaggregationType: 'sum',
headerStyle: { fontWeight: 'normal', color: '#737373' },
editor: function (r) {
const { row: o, col: a, table: s } = r,
l = s.getCellInfo(a, o),
x = context.utils.getIsLock(l);
return x && x.lock ? null : 'input-editors';
},
isModify: true,
splitStrategy: 'PROPORTIONAL',
allocationStrategy: 'MAX',
splitConfig: { precision: 2, minSplitValue: 0.01 },
},
{
indicatorKey: 'original_cost',
title: 'original_cost',
maxWidth: 300,
hide: false,
oibpFilterStyles: [],
oibpType: 'number',
oibpaggregationType: 'sum',
headerStyle: { fontWeight: 'normal', color: '#737373' },
editor: function (r) {
const { row: o, col: a, table: s } = r,
l = s.getCellInfo(a, o),
x = context.utils.getIsLock(l);
return x && x.lock ? null : 'input-editors';
},
isModify: true,
splitStrategy: 'AVERAGE',
allocationStrategy: 'MAX',
splitConfig: {
measureField: 'original_cost',
precision: 2,
minSplitValue: 0.01,
},
},
{
indicatorKey: 'ref_value',
title: 'ref_value',
maxWidth: 300,
hide: false,
oibpFilterStyles: [],
oibpType: 'number',
oibpaggregationType: 'sum',
headerStyle: { fontWeight: 'normal', color: '#737373' },
editor: function (r) {
const { row: o, col: a, table: s } = r,
l = s.getCellInfo(a, o),
x = context.utils.getIsLock(l);
return x && x.lock ? null : 'input-editors';
},
isModify: true,
splitStrategy: 'AVERAGE',
allocationStrategy: 'MAX',
splitConfig: {
measureField: 'ref_value',
precision: 2,
minSplitValue: 0.01,
},
},
],
})
})
</script>
<template>
<div id="container" style="width: 1000px; height: 500px"></div>
</template>
devExtreme代码
<template>
<div>
<div class="long-title">
<h3>Sales Amount by Region</h3>
</div>
<DxPivotGrid
id="sales"
:allow-sorting-by-summary="true"
:allow-sorting="true"
:allow-filtering="true"
:allow-expand-all="true"
:height="440"
:show-borders="true"
:data-source="dataSource"
>
<DxFieldChooser :enabled="false"/>
<DxScrolling mode="virtual"/>
</DxPivotGrid>
</div>
</template>
<script setup lang="ts">
import DxPivotGrid, {
DxFieldChooser,
DxScrolling,
} from 'devextreme-vue/pivot-grid';
import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';
// 引入devextreme相关
import 'devextreme/dist/css/dx.common.css' // devextreme style
import 'devextreme/dist/css/dx.light.compact.css' // devextreme style
import sales from './testdata';
// const c = [...sales, sales.map((item) => {
// const cd = Object.keys(item)
// const c = {}
// cd.map((key) => {
// c[key] = item[key]+1
// })
// return c
// })]
const dataSource = new PivotGridDataSource({
fields: [
{
caption: 'channel',
width: 120,
dataField: 'channel',
area: 'row',
expanded: true,
},
{
caption: 'city',
dataField: 'city',
width: 150,
area: 'row',
expanded: true,
},
{
caption: 'store',
dataField: 'store',
width: 150,
area: 'row',
expanded: true,
},
{
caption: 'city',
dataField: 'city',
width: 150,
area: 'row',
expanded: true,
},
{
caption: 'product_category',
dataField: 'product_category',
width: 150,
area: 'row',
expanded: true,
},
{
caption: 'sku',
dataField: 'sku',
width: 150,
area: 'row',
expanded: true,
},
{
caption: 'year_co',
dataField: 'year_co',
area: 'column',
expanded: true,
},
{
caption: 'year_mth',
dataField: 'year_mth',
width: 150,
area: 'column',
expanded: true,
},
{
caption: 'day_of_month',
dataField: 'day_of_month',
width: 150,
area: 'column',
expanded: true,
},
{
caption: 'original_value',
dataField: 'original_value',
width: 150,
area: 'data',
expanded: true,
dataType: 'number',
summaryType: 'sum',
},
{
caption: 'original_cost',
dataField: 'original_cost',
width: 150,
area: 'data',
expanded: true,
dataType: 'number',
summaryType: 'sum',
},
{
caption: 'ref_value',
dataField: 'ref_value',
width: 150,
area: 'data',
dataType: 'number',
summaryType: 'sum',
expanded: true,
},
],
store: sales,
});
</script>`
### What does the proposed API look like?
见上
- Lingua principale
- TypeScript
- Stelle
- 3.7k
- Fork
- 492
- Merge medio
- 19h 48m
- PR unite (30g)
- 14
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VisActor/VTable
-
bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
VisActor/VTable#5336 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
[Feature]Apertafeature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di VisActor/VTable
Issue simili
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
components-web-app/docs#260 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
521xueweihan/HelloGitHub#4025 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ctrf-io/playwright-ctrf-json-reporter#117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
voidzero-dev/void#478 ·
I maintainer di solito rispondono entro 1 giorno