instance.connect({
source: "src",
target: "tar",
endpoint: ["Dot", {
radius: 5,
cssClass: "hasInfluencedEndpointStrong"
}],
anchor: "Center",
paintStyle: {
width: 25,
height: 21,
fill: "transparent"
},
scope: "hasInfluencedStrong",
isSource: true,
reattach: true,
maxConnections: -1,
connectorStyle: {
stroke: "#708088",
strokeWidth: 2.6,
outlineStroke: "transparent",
outlineWidth: 4
},
connectorOverlays: [
["Arrow", {
location: -15.5,
id: "arrow",
length: 14,
width: 14,
foldback: 1,
direction: 1
}]
],
isTarget: true,
})
Я передал этот объект в функцию jsplumb connect, он ведет себя не так, как ожидалось. Я хочу настроить ширину линии и тип стрелки. Есть ли альтернатива для этого?
ОБНОВЛЕНИЕ: я пытался подключиться, используя uuid конечных точек, также сначала добавляются uuid конечных точек, после чего пытаются их подключить и утешают как uuid, так и конечную точку с одним и тем же uuid, но все равно получаю ошибку источника не существует. введите здесь описание изображения
1 ответ
Это сработало для меня
let e1 = instance.addEndpoint("src", {
endpoint: ["Dot", { radius: 5, cssClass:"hasInfluencedEndpointStrong" }],
anchor: "Center",
paintStyle: {
width: 25,
height: 21,
fill:"transparent"
},
scope: "hasInfluencedStrong",
isSource: true,
reattach: true,
maxConnections: -1,
connectorStyle: {
stroke: "#708088",
strokeWidth: 2.6,
outlineStroke: "transparent",
outlineWidth: 4
},
connectorOverlays:[
[ "Arrow", { location: -15.5, id: "arrow", length: 14, width:14, foldback: 1, direction:1 } ]
]
});
let e2 = instance.addEndpoint("target", {
endpoint: ["Dot", { radius: 5, cssClass:"hasInfluencedEndpointStrong" }],
anchor: "Center",
paintStyle: {
width: 25,
height: 21,
fill:"transparent"
},
scope: "hasInfluencedStrong",
isTarget: true,
reattach: true,
maxConnections: -1,
connectorStyle: {
stroke: "#708088",
strokeWidth: 2.6,
outlineStroke: "transparent",
outlineWidth: 4
},
connectorOverlays:[
[ "Arrow", { location: -15.5, id: "arrow", length: 14, width:14, foldback: 1, direction:1 } ]
]
});
А затем подключите эти конечные точки:
instance.connect({
source:e1,
target:e2
});
Похожие вопросы
Новые вопросы
javascript
По вопросам программирования на ECMAScript (JavaScript/JS) и его различных диалектах/реализациях (кроме ActionScript). Имейте в виду, что JavaScript — это НЕ то же самое, что Java! Включите все ярлыки, относящиеся к вашему вопросу; например, [node.js], [jQuery], [JSON], [ReactJS], [angular], [ember.js], [vue.js], [typescript], [svelte] и т. д.
maxConnections: -1
специально? Похоже, что это может помешать узлам принимать соединения.