带有路径连接器的jQuery可拖动小部件 [英] jQuery draggable widget with path connectors

查看:79
本文介绍了带有路径连接器的jQuery可拖动小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考图像,Block1和Block2都是可拖动的。



我的问题是:如何在两个块之间制作像连接器一样的红色链?要求是链应该延伸到拖动块的任何位置。请提供教程/学习资料的任何指示。谢谢。



解决方案


Referring to the image, both Block1 and Block2 are draggable.

My question is : How do I make the Red coloured chain like connector in between the two blocks? Requirement is that the chain should extend to wherever the blocks are being dragged. Please provide any pointers to tutorials/study materials . Thanks.

解决方案

GoJS lets you define your own custom rendering of link paths, as shown in this sample: http://gojs.net/latest/samples/relationships.html

Here's how you can create the pattern of red chevrons when you define your link template:

$(go.Link, go.Link.Orthogonal,
  $(go.Shape,
    {
      stroke: transparent,
      pathPattern: $(go.Shape,
       {
         geometryString: "F1 M2 3 L0 0 6 0 8 3 6 6 0 6z",
         fill: "red",
         strokeWidth: 0
       })
    })
)

This creates the following result:

这篇关于带有路径连接器的jQuery可拖动小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆