因为公司想要实现精准测试的调用链路关系,在调研图形的时候发现neo4j-broswer的图表(如上)比较满足我们的需求,在网上参考了相关文章,找了相关的vis,d3,antv等图表都不能实现对应效果,所以决定手动从neo4j-broswer剥离图表出来
其中,package.json增加如下包
"d3": "3",
"react-svg-inline": "^2.1.1",
"semantic-ui-react": "^2.0.3",
"styled-components": "^5.3.0",
实现react组件
const GraphComponentWrapper = () => {
const maxNeighbours = 500;//拥有最多邻居数量
const [hoveredItem, setHoveredItem] = useState<any>();
const [selectedItem, setSelectedItem] = useState<any>();
const onGraphModelChange = () => {};
const onItemMouseOver = (item: any) => {
setHoveredItem(item);
};
const onItemSelect = (item: any) => {
setS