Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions common/changes/@visactor/vchart/fix-memory-leaks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: Fix memory leaks in Player component and BaseComponent release logic.",
"type": "patch",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "visactor@bytedance.com"
}
118 changes: 59 additions & 59 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@visactor/vchart-theme": "~1.6.6",
"@visactor/vmind": "1.2.4-alpha.5",
"@visactor/vutils": "~1.0.22",
"@visactor/vrender": "~1.0.40",
"@visactor/vrender-kits": "~1.0.40",
"@visactor/vrender": "~1.0.41",
"@visactor/vrender-kits": "~1.0.41",
"@visactor/vtable": "1.19.0-alpha.0",
"@visactor/vtable-editors": "1.19.0-alpha.0",
"@visactor/vtable-gantt": "1.19.0-alpha.0",
Expand Down Expand Up @@ -58,4 +58,4 @@
"react-device-detect": "^2.2.2",
"minimist": "1.2.8"
}
}
}
6 changes: 3 additions & 3 deletions packages/openinula-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dependencies": {
"@visactor/vchart": "workspace:2.0.17",
"@visactor/vutils": "~1.0.22",
"@visactor/vrender-core": "~1.0.40",
"@visactor/vrender-kits": "~1.0.40",
"@visactor/vrender-core": "~1.0.41",
"@visactor/vrender-kits": "~1.0.41",
"react-is": "^18.2.0"
},
"devDependencies": {
Expand Down Expand Up @@ -78,4 +78,4 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
}
6 changes: 3 additions & 3 deletions packages/react-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"@visactor/vchart": "workspace:2.0.17",
"@visactor/vchart-extension": "workspace:2.0.17",
"@visactor/vutils": "~1.0.22",
"@visactor/vrender-core": "~1.0.40",
"@visactor/vrender-kits": "~1.0.40",
"@visactor/vrender-core": "~1.0.41",
"@visactor/vrender-kits": "~1.0.41",
"react-is": "^18.2.0"
},
"devDependencies": {
Expand Down Expand Up @@ -83,4 +83,4 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const spec = {
},
// animation: false,
customTransformSpec: spec => {
console.log('spec----', spec);
// console.log('spec----', spec);
spec.axes[0].paddingOuter = 0.7;
}
};
Expand Down
10 changes: 5 additions & 5 deletions packages/vchart-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser"
},
"dependencies": {
"@visactor/vrender-core": "~1.0.40",
"@visactor/vrender-kits": "~1.0.40",
"@visactor/vrender-components": "~1.0.40",
"@visactor/vrender-animate": "~1.0.40",
"@visactor/vrender-core": "~1.0.41",
"@visactor/vrender-kits": "~1.0.41",
"@visactor/vrender-components": "~1.0.41",
"@visactor/vrender-animate": "~1.0.41",
"@visactor/vchart": "workspace:2.0.17",
"@visactor/vutils": "~1.0.22",
"@visactor/vdataset": "~1.0.22",
Expand Down Expand Up @@ -66,4 +66,4 @@
"directory": "packages/vchart-extension"
},
"license": "MIT"
}
}
42 changes: 41 additions & 1 deletion packages/vchart/__tests__/runtime/browser/test-page/radar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isMobile } from 'react-device-detect';
import type { IRadarChartSpec } from '../../../../src/index';
import { VChart } from '../../../../src/index';

const run = () => {
const run = async () => {
const mockData: any[] = [];
const types = ['A', 'B', 'C'];

Expand Down Expand Up @@ -69,7 +69,47 @@ const run = () => {
cs.renderAsync().then(() => {
console.timeEnd('renderTime');
});

const c = document.createElement('button');
c.innerHTML = 'release';
c.style.marginRight = '5px';
c.style.marginTop = '5px';
function releaseChart() {
cs.release();
// cs.destroy();
}
c.onclick = releaseChart;
document?.getElementsByTagName('body')[0].appendChild(c);

const d = document.createElement('button');
d.innerHTML = 'reRender';
d.style.marginRight = '5px';
d.style.marginTop = '5px';
function reRenderChart() {
const cs = new VChart(spec, {
dom: document.getElementById('chart') as HTMLElement,
//theme: 'dark',
onError: err => {
console.error(err);
}
});
console.time('renderTime');

cs.renderSync();
window['vchart'] = cs;
}
d.onclick = reRenderChart;
document?.getElementsByTagName('body')[0].appendChild(d);

window['vchart'] = cs;
console.log(cs);

for (let i = 0; i < 1000; i++) {
await new Promise(resolve => setTimeout(resolve, 100));
window['vchart'].release();

await new Promise(resolve => setTimeout(resolve, 100));
reRenderChart();
}
};
run();
Loading
Loading