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

企业关系图谱遇到的问题 #4692

Closed
renchengwei opened this issue Jun 30, 2023 · 6 comments
Closed

企业关系图谱遇到的问题 #4692

renchengwei opened this issue Jun 30, 2023 · 6 comments
Labels
Outdate This issue is too old to be resolved

Comments

@renchengwei
Copy link

Describe the bug

我在使用G6的compactBox布局创建企业关系图谱,遇到2个问题:
1、树形节点在展开的时候,当前节点和上下相邻节点之间的间距变的很大,出现的大量的空白,不知道该如何避免,我希望在节点展开的时候,上下间距不要发生变化。
image
2、如何能够保证当前展开节点的连线避免和同级的其它节点重叠?
image

Your Example Website or App

https://codesandbox.io/s/g6-forked-ltpp7y?file=/index.js

Steps to Reproduce the Bug or Issue

1、打开实例。
2、点击高管-郑素方

Expected behavior

1、节点在展开的时候,上下相邻节点和当前节点间距不变。
2、节点在展开的时候,保证子节点在同级节点外,即当前节点和子节点之间的折线能够自适应。

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

@Yanyan-Wang
Copy link
Contributor

  1. 不行呀,展开子树需要腾出空间给到它
  2. 加大层间距 https://g6.antv.antgroup.com/api/tree-graph-layout/compact-box#layoutcfggethgap

@renchengwei
Copy link
Author

  1. 不行呀,展开子树需要腾出空间给到它
  2. 加大层间距 https://g6.antv.antgroup.com/api/tree-graph-layout/compact-box#layoutcfggethgap

1、展开子树的时候我想控制子树节点的位置能够在当前节点之外,类似下面这个例子,在这个例子中,子树的展开没有影响到当前节点上下级的位置
image

2、由于每个节点的文本是企业名称,我无法提前确定企业名称的长度,从而也无法提前确定HGap的值,所以HGap能够根据自适应吗?我感觉固定值无法满足我的需求。

哪位大神能够指点一下,谢谢!

@Yanyan-Wang
Copy link
Contributor

getHGap 是函数式配置,其参数就是节点数据,里面应该可以拿到文本?

@HuColin
Copy link

HuColin commented Feb 18, 2024

antvis/hierarchy#16

你看看第一个问题是不是和这个问题是同一个

@HuColin
Copy link

HuColin commented Feb 18, 2024

2、由于每个节点的文本是企业名称,我无法提前确定企业名称的长度,从而也无法提前确定HGap的值,所以HGap能够根据自适应吗?我感觉固定值无法满足我的需求。

第二个问题建议做成固定节点宽度+超出tooltip,不然容易出现展开某一层级后,页面内容整体向右移动

@Aarebecca Aarebecca added the Outdate This issue is too old to be resolved label Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 2024

This issue has been closed because it has been outdate for a long time.
Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了
如果你仍然需要帮助,请创建一个新的 issue。

@github-actions github-actions bot closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Outdate This issue is too old to be resolved
Projects
None yet
Development

No branches or pull requests

4 participants