admin管理员组文章数量:1317906
I have used Jointjs diagramming library in one of my project.
1) I'm curious to know whether it provides any way to restrict users not to play with the elements of the diagram. What I mean is: a user would be able to see the diagram as an image rather than interacting with it like resizing, changing position, dragging links, etc.
2) My app is depending on it badly. Though I have solved the issue of auto layout, but is that possible with Jointjs, can we just tell the lib that we want these elements and stuff and please help us in making the diagram with best suitable, non-colliding elements and with a minimum number of links colliding with each other and with the elements in their path if the links are continuous straight lines ?
3) Lastly, i want to know if we can check links colliding with other elements or with other links in the same diagram. I know it is possible in case of elements.
if (element1.getBBox().intersect(element2.getBBox())) {
// elements intersect
}
I have used Jointjs diagramming library in one of my project.
1) I'm curious to know whether it provides any way to restrict users not to play with the elements of the diagram. What I mean is: a user would be able to see the diagram as an image rather than interacting with it like resizing, changing position, dragging links, etc.
2) My app is depending on it badly. Though I have solved the issue of auto layout, but is that possible with Jointjs, can we just tell the lib that we want these elements and stuff and please help us in making the diagram with best suitable, non-colliding elements and with a minimum number of links colliding with each other and with the elements in their path if the links are continuous straight lines ?
3) Lastly, i want to know if we can check links colliding with other elements or with other links in the same diagram. I know it is possible in case of elements.
if (element1.getBBox().intersect(element2.getBBox())) {
// elements intersect
}
Share
Improve this question
asked Feb 25, 2014 at 19:05
softvarsoftvar
18.5k13 gold badges57 silver badges77 bronze badges
1 Answer
Reset to default 81) Use either new joint.dia.Paper({ interactive: false, ... })
or set pointer-events CSS property to none directly on the paper: paper.$el.css('pointer-events', 'none')
2) You can use the joint.layout.DirectedGraph plugin. This plugin is downloadable here: http://jointjs./download and a blog post describing it is here: http://www.daviddurman./automatic-graph-layout-with-jointjs-and-dagre.html.
3) This is not, in general, easy. I'd point you to this site for an example of puting intersection between two paths: http://www.kevlindev./geometry/2D/intersections/intersect_bezier2_bezier2.svg. Here is the library for download then: http://www.kevlindev./gui/math/intersection/index.htm
本文标签: javascriptMake elements 39not selectable39 in jointjsStack Overflow
版权声明:本文标题:javascript - Make elements 'not selectable' in jointjs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742030781a2416401.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论