Closed
Description
Issue type
Feature request
Description of new feature
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 whenfalse
, 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.
Metadata
Metadata
Assignees
Labels
No labels