向jsPlumb锚定添加偏移量
问题描述:
我使用jsplumb来表示作业之间的依赖关系。 请看下面的jsfiddle,看看我到目前为止。 JsFiddle向jsPlumb锚定添加偏移量
var arrow_template = {
connector:"StateMachine",
paintStyle:{lineWidth:3,strokeStyle:"#0060CF"},
hoverPaintStyle:{strokeStyle:"#dbe300"},
endpoint:"Blank",
anchors:["Right", "Left"],
reattach:false,
overlays:[["PlainArrow", {location:1, width:10, length:10} ]]
};
我想添加一些水平偏移到连接的左侧被定位,以便它不会随滚动条去。而是从面板边界开始。
我已阅读documentation for anchors这里,但我不完全理解。当我尝试使用锚点设置值玩时,我没有连接/箭头。
感谢任何帮助。
答
除了提供一个锚的位置和方向,你可以选择提供两个定义为给定的位置像素的偏移参数。
所以如果你用anchors:[[1, 0.5, 0, 0, 18, 0], "Left"],
替换anchors:["Right", "Left"],
你的问题将被解决。
太好了!我没有意识到我可以为每个锚/端点提供这6个参数。 感谢您的帮助。 – icramc