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 #9

Open
zhanghui-space opened this issue Dec 26, 2019 · 5 comments
Open

边连线有bug #9

zhanghui-space opened this issue Dec 26, 2019 · 5 comments

Comments

@zhanghui-space
Copy link

两个节点如果有连线,再连的话,表现上正常,打印出来的数据不对

@caoyu48
Copy link
Owner

caoyu48 commented Dec 26, 2019

这个没做限制 如果有需要可以自己加条件判断哦

@zhanghui-space
Copy link
Author

zhanghui-space commented Dec 26, 2019

嗯,谢谢,已修改,没有想到更好的方法

  const edgesData = this.graph.save().edges
  const uniq = edgesData.some((edge) => {
    return isEqual(edge.start, model.start) && isEqual(edge.end, model.end)
  })
  if (!uniq) {
    eventBus.$emit('addItem', model)
  }

另外,想请教一下,如果拿画好的图的数据来渲染的话rend(data) 这里data.edges 是不是应该有targetAnchor,sourceAnchor字段来指定边连得是那个锚点

@caoyu48
Copy link
Owner

caoyu48 commented Dec 26, 2019

嗯 这个可以参考官方文档

@caoyu48
Copy link
Owner

caoyu48 commented Dec 26, 2019

是要指定targetAnchor,sourceAnchor 可以根据nodes edges算出来的

@zhanghui-space
Copy link
Author

谢谢楼主,我尝试了一下用getLinkPointByAnchor方法把锚点与模拟(视觉)锚点坐标联系起来就ok

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

No branches or pull requests

2 participants