You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the following options to eles.boundingBox() (and eles.renderedBoundingBox()):
includeMainLabels : A boolean, whether to include the main label in the returned bounds.
includeSourceLabels : A boolean, whether to include the source label of an edge in the returned bounds.
includeTargetLabels : A boolean, whether to include the target label of an edge in the returned bounds.
Behaviour to maintain compatibility with existing apps:
The existing includeLabels option acts as an override when false, excluding all the labels in the bounding box result.
Each flag is true by default.
Motivation for new feature
See #1679. If you can query an element for only the bounding box of a particular label, then it's easy to determine whether an event.position is within the bounds of the label.
By using this feature, a programmer can add features like direct manipulation of labels (e.g. drag on a label to move it). It also allows for features like click-to-type. Those sorts of features would make great extensions.
This proposed feature enables these use-cases with minimal added complexity of the Cytoscape.js API.
Activity
[-]`eles.boundingBox()` options : `includeLabel`, `includeSourceLabel`, `includeTargetLabel`[/-][+]`eles.boundingBox()` options : `includeMainLabels`, `includeSourceLabels`, `includeTargetLabels`[/+]maxkfranz commentedon Aug 30, 2019
The original spec has been updated to be more consistent. Each option is plural.
`eles.boundingBox()` options : `includeMainLabels`, `includeSourceLab…