在 JointJs 中,如何在类似于 3ds max 创建图的元素之间建立链接?

In JointJs, how to have links between elements that resemble the 3ds max creation graphs?

我有一个 JointJs 图。我希望图表中元素之间的链接看起来像这样:

我们开箱即用,而不是直线。

基本上,箭头在与目标的交点处是水平的,并且弯曲平滑。

如何实现?

link 连接器就是您要找的东西。

你调整特定的link:

link.set('connector', { name: 'normal' });
link.set('connector', { name: 'smooth' });
link.set({name : 'rounded', args:{radius: 50}});

或者您可以为图表中的所有 link 设置默认值

var paper = new joint.dia.Paper({
        width: 800,
        height: 800,
        gridSize: 1,
        model: graph,
        defaultConnector: {
            name: 'smooth'
        }
    });