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

[Bug]: Edge Label Rotation Issue #6856

Open
2 of 10 tasks
dtg2018 opened this issue Mar 11, 2025 · 2 comments
Open
2 of 10 tasks

[Bug]: Edge Label Rotation Issue #6856

dtg2018 opened this issue Mar 11, 2025 · 2 comments
Labels
waiting for author Further information is requested from the author.

Comments

@dtg2018
Copy link

dtg2018 commented Mar 11, 2025

Describe the bug / 问题描述

Description
When setting autoRotate: false for edge labels, the labels should remain horizontal instead of following the edge path. However, the labels still follow the edge direction instead of staying upright.

Expected Behavior

The label should always remain horizontal, regardless of the edge's angle.
Current Behavior

Even when autoRotate: false, the label follows the edge path's orientation.

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

edge: { type: 'line', style: { badgeText: (edge: any) => edge.edgeBadgeText, lineWidth: (edge: any) => edge.edgeWidth, badgeWordWrap: true, autoRotate: false, stroke: '#7c7c7c', border: '1px solid #bdbdbd', badgeTextBaseline: 'middle', badgeFontSize: 10, badgeFill: '#727272', badgeBackground: true, badgeBackgroundFill: '#fdfdfd', badgeBackgroundFillOpacity: 1, badgeBackgroundRadius: 5, }, },
Observe that the label still follows the edge's direction instead of staying horizontal.

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@dtg2018 dtg2018 added the waiting for maintainer Triage or intervention needed from a maintainer. label Mar 11, 2025
Copy link

It seems that you are experiencing an issue with the autoRotate property for edge labels in antvis/G6 version 5.x. When autoRotate is set to false, the labels are expected to remain horizontal, but they are still following the edge's direction.

Here's a quick checklist to ensure everything is set up correctly:

  1. Configuration Check: Ensure that the labelCfg is correctly applied to the edge configuration. Double-check the syntax and ensure there are no typos.

  2. Version Compatibility: Make sure you are using the latest version of G6, as there might be updates or bug fixes related to this issue.

  3. Custom Rendering: If the default behavior is not as expected, consider implementing a custom label rendering function to control the label's orientation manually.

If you've verified these and the issue persists, it might be a bug. Unfortunately, I can't create an issue directly, but you can report this on the antvis/G6 GitHub repository if it's not already reported.

If you need further assistance or have additional questions, feel free to ask!

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@yvonneyx
Copy link
Contributor

Thank you for reporting this. Have you tried "labelAutoRotate"? It may fix the issue of the label not staying horizontal when autoRotate: false. If it doesn't work, let us know.

@yvonneyx yvonneyx added waiting for author Further information is requested from the author. and removed waiting for maintainer Triage or intervention needed from a maintainer. labels Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Further information is requested from the author.
Projects
None yet
Development

No branches or pull requests

2 participants