You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
import React, { useRef, useEffect, useState } from 'react';
import { Graph } from '@antv/g6';
const G6Graph: React.FC = () => {
const containerRef = useRef(null);
const graphRef = useRef<Graph | null>(null);
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
// 生成节点数据的函数
const generateNodes = (width: number, height: number, nodeCount: number = 3000) => {
// 开始计时
const startTime = performance.now();
};
useEffect(() => {
if (!containerRef.current) return;
}, []);
return (
<div
ref={containerRef}
style={{
width: '1000px',
height: '800px',
border: '1px solid #ccc',
overflow: 'hidden',
}}
/>
);
};
export default G6Graph;
这个是我的react组件,但是似乎渲染5000个节点的时候就变得特别慢,长达10s+,G6最新版本

Beta Was this translation helpful? Give feedback.
All reactions