-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Feat: Box selection of partially selected lines #3360
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
base: unstable
Are you sure you want to change the base?
Feat: Box selection of partially selected lines #3360
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We should address both contain
and overlap
for nodes. We should also make sure that the default stylesheet has overlap
for nodes and contain
for edges, to be consistent with existing behaviour (compatibility).
includeLabels: nodeBoxSelectMode && eventsEnabled, | ||
}); | ||
|
||
if (math.boundingBoxesIntersect(boxBb, nodeBb)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the logic for box-selection:overlap for nodes
What about box-selection:contain for nodes? Probably the bounds of the node body and rotated label box can just be checked for containment. These functions would be useful for this: https://github.com/cytoscape/cytoscape.js/blob/unstable/src/math.mjs#L363-L372
Also the |
@@ -234,7 +235,7 @@ const styfn = {}; | |||
{ name: 'text-border-style', type: t.borderStyle, triggersBounds: diff.any }, | |||
{ name: 'text-background-shape', type: t.textBackgroundShape, triggersBounds: diff.any }, | |||
{ name: 'text-justification', type: t.justification }, | |||
{ name: 'box-select-labels', type: t.bool, triggersBounds: diff.any }, | |||
{ name: 'box-selection', type: t.boxSelection } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prop should only be specced out once. Not here since it doesn't affect the label visual style.
@@ -407,7 +408,8 @@ const styfn = {}; | |||
{ name: 'loop-direction', type: t.angle, triggersBounds: diff.any }, | |||
{ name: 'loop-sweep', type: t.angle, triggersBounds: diff.any }, | |||
{ name: 'source-distance-from-node', type: t.size, triggersBounds: diff.any }, | |||
{ name: 'target-distance-from-node', type: t.size, triggersBounds: diff.any } | |||
{ name: 'target-distance-from-node', type: t.size, triggersBounds: diff.any }, | |||
{ name: 'box-selection', type: t.boxSelection } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be here either.
behaviour
is a good place
@jquery404, do you think you could make the changes in the next few days? I'm releasing the next feature release soon, and I'll be away for over a month starting next week. |
Cross-references to related issues.
Example of the issue:

Associated issues:
Notes re. the content of the pull request. Give context to reviewers or serve as a general record of the changes made. Add a screenshot or video to demonstrate your new feature, if possible.
box-select-lines: yes
. When this attribute is included, line can be selected even if at least one (start or end point) is inside the user selection box.📸 Demo:

Checklist
Author:
unstable
. Bug-fix patches can go on eitherunstable
ormaster
.index.d.ts
Typescript definition file has been appropriately updated.Reviewers:
master
branch and theunstable
branch. Normally, this just requires cherry-picking the corresponding merge commit frommaster
tounstable
-- or vice versa.cc: @maxkfranz