gpt4 book ai didi

javascript - JointJS 中流的标签

转载 作者:行者123 更新时间:2023-11-30 20:48:52 25 4
gpt4 key购买 nike

我正在使用 jointJs 和 Rappid。我知道如何绘制 bpmn 图,就像我附上的照片一样。我正在绘制元素,但我在行(流)方面遇到了一些问题。有没有办法添加流标签或名称?正如我在图像中添加的红色。

我在他们的文档中看到了这个,但是我看不到任何关于标签的信息

var flow = new joint.shapes.bpmn.Flow({
source: { id: task.id },
target: { id: annotation.id },
flowType: 'association'

});

enter image description here

谢谢,

最佳答案

您可能需要查看 dia.Link.prototype.labels ,因为 BPMN 流只是链接扩展 (joint.shapes.bpmn.Flow = joint.dia.Link.extend({))。

您的流程示例:

flow.label(0, // the label's index (you can have multiple labels per link/flow)
{
position: .5, // place it halfway on the link (0-1)
attrs: {
text: { fill: 'red', text: 'Label' }
}
}
);

关于javascript - JointJS 中流的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48399021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com