Skip to content

WiP feat: link external label with its parent #2328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jarekdanielak
Copy link
Contributor

Related to camunda/camunda-modeler#369

Proposed Changes

Show a dotted link between an external label and its parent when it's selected.

link-labels

To do

  • Find the proper layer to draw the lines on for non-root planes (e.g. expanded subprocesses)
  • Find a better "middle point" for sequence flows with complicated shapes (not a straight line)
  • Add tests
  • Make the line more delicate

Try

Run npm start on this branch and try it out.

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

LabelLink.$inject = [ 'eventBus', 'canvas' ];

// TODO: Works kinda weird with complicated sequence flows.
function getMiddle(element) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you want to use is LineIntersection#getApproxIntersection(waypoints, reference) or a derivative. This gives you the closest anchor point, either on a bendpoint, or on the connection itself.

Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great:

  • self contained
  • simple enough
  • working well

Looking forward for the follow-up to get it into the tool. One thing to consider: Whether to make it an (optional) diagram-js feature. I see that other tools, i.e. dmn-js, may benefit from it, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog spring cleaning Could be cleaned up one day
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants