Skip to content

Bug: Sequence diagram - multi-row self referential messages overlap arrow #1143

@alexstoick

Description

@alexstoick

Screenshot of the issue:
Screenshot2023-04-05at14 02 58

This issue stems from the fact that the arrow size is hardcoded here:
https://github.com/alexstoick/d2/blob/master/d2layouts/d2sequence/sequence_diagram.go#L561

To resolve we could simply update the value of endY, so that it would be computed based on how long the self-referential message is.
However, changing just the endY will potentially end up with overlapping the arrow with the next message due to the fact that yStep is hardcoded based on the longest current message in the whole sequence diagram. There is a TODO note here: https://github.com/alexstoick/d2/blob/master/d2layouts/d2sequence/sequence_diagram.go#L164

Potential proposed solution would be to line 561 update:

endY := startY + float64(message.LabelDimensions.Height)*1.5 and then further down on line 576 to update to:
messageOffset += float64(message.LabelDimensions.Height) + MIN_MESSAGE_DISTANCE*1.5

With these changes the diagram would look like:

image


It would be great to tackle the removal of the yStep as a whole and adapt individual yStep calculations - but that can be raised as a separate issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions