我正在使用 fsa 插件在joint.js 中构建一个FSA 应用程序。但是,每当我将鼠标悬停在链接上时,它们就会消失。
这是相关的javascript代码:
function link(source, target, label, maxsize) {
var vertices = []
if (source.id == target.id) {
vertices = [{ x:source.attributes.position.x+10*maxsize, y:source.attributes.position.y-40 }, { x:source.attributes.position.x+10*maxsize, y:source.attributes.position.y+40 }];
}
var w = parseInt(label,10);
if (source.id == init.id || target.id == term.id)
label = "";
var cell = new joint.shapes.fsa.Arrow({
source: { id: source.id },
target: { id: target.id },
labels: [{ position: .5, attrs: { text: { text: label || '', 'font-weight': 'bold' } } }],
vertices: vertices || []
});
cell.weight = w;
return cell;
}
我该如何解决?