Skip to content
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

Move edge labels #411

Conversation

jbicker
Copy link
Contributor

@jbicker jbicker commented Dec 15, 2023

This PR introduces a new configuration option for enhanced label positioning related to edges. It adds the possibility to move labels along the edge or completely free. Or set the moveMode to none to not move a certain label at all.

The move feature must be enabled in the di config for make label placement work.
For type-safe edge placement, the corresponding element type in the sprotty model must be extended with EdgeLayoutable type.
If edgePlacement is not specified, the label is placed at default position, with the exception that labels can be freely moved.
When edgePlacement is configured and moveMode is set to 'none', labels will not be moveable.
If edgePlacement is set and moveMode is 'edge', labels are constrained to movement along the associated edge. This also serves as the default behavior when moveMode is undefined.
When edgePlacement is configured and moveMode is 'free', labels can be moved freely in any direction.

Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

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

Thanks! Two remarks below

freely or constrain them to the edge
@jbicker jbicker force-pushed the jbicker/labels-allow-to-move-edge-55 branch from 84804b9 to a0681b2 Compare December 21, 2023 10:07
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

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

👍

@spoenemann spoenemann merged commit e5b2c77 into eclipse-sprotty:master Jan 2, 2024
2 of 3 checks passed
@spoenemann spoenemann added this to the v1.1.0 milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants