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

jumpover经过相同路径时,出现异常跳线 #3828

Open
18663872803 opened this issue Aug 3, 2023 · 2 comments
Open

jumpover经过相同路径时,出现异常跳线 #3828

18663872803 opened this issue Aug 3, 2023 · 2 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@18663872803
Copy link

18663872803 commented Aug 3, 2023

image

使用2.11.3版本中的example进行的测试,经过同一路径节点,出现了跳线。

是项目中应用发现的,想得到一个转折处(类丁字路口)平滑的效果,不出现跳线,如:
image
但实际项目中出现了
image
demo代码如下:
`
const graph = new Graph({
container: this.container,
width: 800,
height: 1400,
grid: 10,
})

// Default connection of two elements.
// -----------------------------------

const r1 = graph.addNode({
  shape: 'rect',
  width: 70,
  height: 30,
  x: 200,
  y: 50,
  attrs: {
    body: { fill: '#1890ff', stroke: '#1890ff' },
    text: { text: 'box', fill: '#fff', magnet: true },
  },
})

var r2 = r1.clone()
graph.addNode(r2)
r2.translate(300)

graph.addEdge({
  source: r1,
  target: r2,
  label: 'default',
})

// Changing source and target selectors of the edge.
// -------------------------------------------------
var r3 = r1.clone()
graph.addNode(r3)
r3.translate(0, 80)

var r4 = r3.clone()
graph.addNode(r4)
r4.translate(300)

graph.addEdge({
  source: { cell: r3.id },
  target: { cell: r4.id, selector: 'text' },
  label: 'link to selector',
})

// Vertices.
// ---------
var r5 = r3.clone()
graph.addNode(r5)
r5.translate(0, 80)

var r6 = r5.clone()
graph.addNode(r6)
r6.translate(300)

graph.addEdge({
  source: r5,
  target: r6,
  vertices: [
    { x: 235, y: 280 },
    { x: 535, y: 280 },
  ],
  label: 'vertices',
})

// // Manhattan routing.
// // ------------------
var r7 = r5.clone()
graph.addNode(r7)
r7.translate(0, 100)

var r8 = r7.clone()
graph.addNode(r8)
r8.translate(200, 80)

graph.addEdge({
  source: r7,
  target: r8,
  vertices: [{ x: 620, y: 325 }],
  router: { name: 'metro' },
  label: 'metro router',
})
graph.addEdge({
  source: r7,
  target: r8,
  vertices: [{ x: 140, y: 405 },{ x: 140, y: 450 },{ x: 440, y: 450 }],
  router: { name: 'normal' },
  connector: { name: 'jumpover' }
})
graph.addEdge({
  source: r7,
  target: r8,
  vertices: [{ x: 140, y: 405 },{ x: 140, y: 450 },{ x: 240, y: 450 },{ x: 240, y: 400 }],
  router: { name: 'normal' },
  connector: { name: 'jumpover' }
})
graph.addEdge({
  source: r7,
  target: r8,
  vertices: [{ x: 140, y: 405 },{ x: 140, y: 450 },{ x: 160, y: 450 },{ x: 160, y: 500 },{ x: 180, y: 500 },{ x: 180, y: 500 }],
  router: { name: 'normal' },
  connector: { name: 'jumpover' }
})

`

Originally posted by @18663872803 in #3149 (comment)

@x6-bot
Copy link
Contributor

x6-bot bot commented Aug 3, 2023

👋 @18663872803

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@NewByVector
Copy link
Contributor

这个效果应该不是问题,如果没有那个跳线的话,无法表现出连线走向。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Sep 7, 2023
Wangjing991 added a commit to Wangjing991/X6 that referenced this issue Apr 25, 2024
NewByVector pushed a commit that referenced this issue Apr 28, 2024
…#4279)

fix:  If the starting or ending point is the same as the intersection point, return

#4042
#3828
解决跳线异常问题
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

2 participants