Skip to content

Improve the accuracy of label bounding box calculations and rendering #3417

@fzaman-linz

Description

@fzaman-linz

Description of new feature

Improves the precision of label bounding box calculations and rendering by introducing new style properties and refining the handling of label metrics.

Motivation for new feature

Currently, different fonts introduce extra space for hanging characters (e.g., 'g', 'p', 'j', 'q'), which expands the bounding box unnecessarily. This additional space makes it difficult to select labels when overlaps occur. The extra space becomes quite substantial when the text is rotated, making the bounding box even larger and more difficult to manage.
Here is an example:

Image

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

  • Ensure that the reporter has adequately described their idea. If not, elicit more information about the use case. You should iteratively build a spec together.
  • Ensure that the issue is a good fit for the core library. Some things are best done in extensions (e.g. UI-related features that aren't style-related). Some things are best done by app authors themselves -- instead of in Cytoscape libraries.
  • The issue has been associated with a corresponding milestone.
  • The commits have been incorporated into the unstable branch via pull request. The corresponding pull request is cross-referenced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feedbackWaiting for feedback on comments, or changes to a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions