import { useEffect, useRef } from 'react'; import { ForceGraph2D } from 'react-force-graph'; import { graphData } from './constant'; const Next = () => { const graphRef = useRef(); useEffect(() => { graphRef.current.d3Force('cluster'); }, []); return (
{ return node.id; }} // nodeVal={(node) => { // return
xxx
; // }} // nodeVal={(node) => 100 / (node.level + 1)} linkAutoColorBy={'type'} nodeCanvasObjectMode={() => 'after'} nodeCanvasObject={(node, ctx) => { console.info(ctx); return ctx.canvas; }} // nodeVal={'id'} />
); }; export default Next;