Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph关系图,force布局,数据太多,能不能通过api自定定位到某个节点呢? #330

Closed
qingyun1029 opened this issue Jun 29, 2024 · 1 comment

Comments

@qingyun1029
Copy link

以这个demo为例:https://www.relation-graph.com/#/demo/vue2?id=layout-force
如果数据太多,可能会超出画布,所以需要做一个搜索节点的功能,把所有节点放到下拉里面,然后搜索,对搜索出的结果项点击,然后关系图自定把点击的节点放到展示关系图的中心位置,谢谢!

@seeksdream
Copy link
Owner

请参考这个示例:
https://www.relation-graph.com/#/demo/vue2?id=search-and-focus

核心知识为:
定位到节点的api: await graphInstance.focusNodeById(nodeId)
展示节点下拉菜单:通过图谱插槽写一个可筛选的下拉list(示例中使用的是element-ui的el-select)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants