Skip to content

feat(connector): add jumpDirection option to jumpover connector#5058

Open
ylcr003 wants to merge 2 commits into
antvis:masterfrom
ylcr003:feature/jumpover-jump-direction
Open

feat(connector): add jumpDirection option to jumpover connector#5058
ylcr003 wants to merge 2 commits into
antvis:masterfrom
ylcr003:feature/jumpover-jump-direction

Conversation

@ylcr003

@ylcr003 ylcr003 commented Apr 14, 2026

Copy link
Copy Markdown

📝 Description

Add a new jumpDirection option to the jumpover connector to control which line orientation produces the jump arc at intersections.

  • 'both' (default) — existing behavior, unchanged
  • 'horizontal' — only horizontal lines jump over crossing vertical lines
  • 'vertical' — only vertical lines jump over crossing horizontal lines

🖼️ Screenshot

jumpDirection: 'both' (default) jumpDirection: 'horizontal'
Both directions may produce arcs Only horizontal lines arc

💡 Motivation and Context

In some business scenarios (e.g. orthogonal routing graphs), it is visually cleaner to always have horizontal lines jump over vertical lines, rather than letting the arc appear on whichever line was drawn later (index-based). This option gives users explicit control over which line direction is responsible for the jump arc.

New API:

graph.addEdge({
  connector: {
    name: 'jumpover',
    args: {
      jumpDirection: 'horizontal', // 'both' | 'horizontal' | 'vertical'
    },
  },
})

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a jumpDirection option to the jumpover connector, allowing users to specify whether jump arcs should be applied to horizontal, vertical, or both types of lines. The update includes the core logic implementation, a new demonstration page in the examples, and unit tests. Feedback points out a bug in the deduplication logic that could prevent arcs from appearing when using specific direction settings and suggests correcting the UI description in the example to accurately reflect that the later-drawn edge produces the jump arc.

Comment thread src/registry/connector/jumpover.ts
Comment thread examples/src/pages/connector/jumpover-direction.tsx
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ylcr003

ylcr003 commented Apr 14, 2026

Copy link
Copy Markdown
Author

实际遇到了这样的业务场景,所以提个PR,给广大牛马提供一点帮助和便捷

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

Successfully merging this pull request may close these issues.

2 participants