Skip to content

Support text templates for shape labels #6511

Closed
@emilykl

Description

@emilykl

Add support for text templates in shape labels.

Add a text template property to shape.label, with support for displaying variables which are updated automatically based on the shape's properties -- for example, the x/y coordinates of a rectangle or the slope of a line.

This feature depends on #6454 (Support adding text labels to lines and shapes).

Proposed API

  • Add a shape.label.texttemplate property
  • Template string format identical to hovertemplate / texttemplate, where variables can be included in the string using the syntax %{variable}.
  • A limited number of variables are supported, including at least:
    • Shape properties x0, x1, y0, y1
    • Calculated value slope
    • Possibility to include other variables
  • Displayed text is updated in real time as values change, including during drag

Partnership

Development of this feature is sponsored by Volkswagen's Center of Excellence for Battery Systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions