向地址添加叠加箭头不起作用

时间:2014-03-31 16:05:57

标签: javascript jsplumb

我正在使用此makeSource代码并根据docs添加端点样式:

jsPlumb.makeSource(connect, {
    parent: newEntity,
    anchor: 'Continuous',
    connector: 'Flowchart',
    paintStyle: {
        fillStyle: 'rgba(123, 123, 123, 1)',
        radius: 1,
    },
    overlays:[ 
        ['Arrow', {width: 10, length: 30, location: 1}],
    ],
});

我没有收到错误。

Overlay

1 个答案:

答案 0 :(得分:6)

更新了 FIDDLE

对于jsPlumb.makeSource(),属性名称为connectorOverlays SOURCE )。以下是示例代码:

jsPlumb.makeSource("someDiv", {
...
endpoint:{
   connectorOverlays:[ 
     [ "Arrow", { width:10, length:30, location:1, id:"arrow" } ], 
     [ "Label", { label:"foo", id:"label" } ]
   ]
}
...
});

或者,您可以将其设置为默认值:

jsPlumb.Defaults.Overlays = [
            [ "Arrow", { 
                location:1,
                id:"arrow",
                length:14,
                foldback:0.8
            } ]
];