Skip to content

dia.link and dia.element #2028

Answered by kumilingus
CodeSippr asked this question in Q&A
Feb 7, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

This is the default behavior of the Boundary connection point. The connection point function tries to find the geometry of the magnet first. If the magnet is a <g/>, it looks inside for any graphics element such as <rect/>, `. In case of UML Class, there are 3 rectangles and the connection point picks the first one.

You can use a custom connection point that defines different selector for different elements (as we do in the Kitchen Sink application).

defaultConnectionPoint: function(endPathSegmentLine, endView, endMagnet) {
  return joint.connectionPoints.boundary.call(this, endPathSegmentLine, endView, endMagnet, {
     selector: endView.model.get('type') === 'uml.Class' ? 'root' : 'body'

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@CodeSippr
Comment options

@kumilingus
Comment options

@CodeSippr
Comment options

Answer selected by CodeSippr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants