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

节点不居中 #273

Closed
VVVLZ opened this issue Feb 21, 2024 · 1 comment
Closed

节点不居中 #273

VVVLZ opened this issue Feb 21, 2024 · 1 comment

Comments

@VVVLZ
Copy link

VVVLZ commented Feb 21, 2024

无标题
请问一下这个怎么解决啊

@seeksdream
Copy link
Owner

relation-graph有一个选项moveToCenterWhenRefresh,设置为true就可以在初始化时居中。https://www.relation-graph.com/#/docs/graph
或者你也可以在任何时候通过以下方法让图谱居中并缩放到和合适比例:

graphInstance.setZoom(100);
graphInstance.moveToCenter();
graphInstance.zoomToFit();

如果还是不能满意,你可以通过设置画布偏移量,让图谱显示到你认为居中的位置:

https://www.relation-graph.com/#/options-tools

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