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

Fix #19311:[Bug fixing]Edge arrows do not scale on zoom in/out #19384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unreliable-tn
Copy link

@unreliable-tn unreliable-tn commented Dec 12, 2023

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Edge arrows now scale upon zooming in and out in graph view, just like the nodes

Fixed issues

#19311

Details

Before: What was the problem?

When zooming in and out on a graph, the nodes scale properly, but the arrows on the edges do not. This results in a visual imbalance where the arrows appear disproportionately large or small compared to the nodes at different zoom levels, leading to a degradation in the readability and aesthetic appeal of the graph.

Before Zooming:
Screenshot 2023-12-12 at 01 15 38
After Zooming:
Screenshot 2023-12-12 at 01 15 53

After: How does it behave after the fixing?

The arrows on the edges now scale in proportion with the nodes, maintaining a consistent and relative size at all zoom levels, ensuring a balanced and visually coherent graph representation, irrespective of the zoom.

Here the node is size 20 and arrow is 10. As shown in the screenshots, on both zoom levels, the arrow appears to be about half as large as the node.

Before Zooming:
Screenshot 2023-12-12 at 01 16 03
After Zooming:
Screenshot 2023-12-12 at 01 16 14

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

  • Please squash the commits into a single one when merging.

Other information

Copy link

echarts-bot bot commented Dec 12, 2023

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

@unreliable-tn unreliable-tn changed the title Fix #19247:[Bug fixing]Edge arrows do not scale on zoom in/out Fix #19311:[Bug fixing]Edge arrows do not scale on zoom in/out Dec 12, 2023
Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

I don't think the original behavior is a bug because the size of the symbol is in pixels and thus it's natural to remain unchanged when zooming. However, I think this could serve as a new feature with an extra option called symbolScaleRatio, and works lile nodeScaleRatio.

@Ovilia
Copy link
Contributor

Ovilia commented Dec 14, 2023

Please also fix the lint problems.

Copy link
Contributor

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19384@63f6ea3

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

Successfully merging this pull request may close these issues.

2 participants