Skip to content

Class diagrams: Self referential multiplicity is displayed multiple times #7560

@robkorv

Description

@robkorv

Description

In Class diagrams: Self referential multiplicity is displayed multiple times

Steps to reproduce

Render this diagram:

classDiagram
    class SelfReferential{
        +int id
        +int self_referential_id
        +SelfReferential referenced
    }
    SelfReferential "1" --> "0..1" SelfReferential : referenced

Screenshots

The multiplicity is displayed thrice:
Image
live editor

classDiagram
    class SelfReferential{
        +int id
        +int self_referential_id
        +SelfReferential referenced
    }
    SelfReferential "1" --> "0..1" SelfReferential : referenced

Loading

gh render

Code Sample

classDiagram
    class SelfReferential{
        +int id
        +int self_referential_id
        +SelfReferential referenced
    }
    SelfReferential "1" --> "0..1" SelfReferential : referenced

https://mermaid.live/edit#pako:eNpdkMtugzAQRX8FzbYE2cG8vOim_YJmV1mKLDwQK2BHxkhNEf9eQ-iLu_Hc8ZnrxwS1VQgc6k4Ow6uWrZO9MFHQ2olO2DVv2KBD47XspsfeoidtfKTVrjEE_ux-B87_iF1atIE1btD8WPaYACogOhyeQ0WSZDF7hP_Jghh6dL3UKjxsvbEAf8EeBfBQKumuAoSZAydHb093UwP3bsQYnB3bC_BGdkNw401Jj9uvfCM3ad6t_bGtW47ZptEodC92NB54taLAJ_gATrM0yRglOWWEpnlxjOEOnJVJSY8ZpYwxUtFyjuFzjSZJWWQkKMtZVVQsT-cvTgyEbg

Setup

  • Mermaid version v11.13.0:
  • Browser and Version:
    • Chrome 146.0.7680.164
    • Edge 145.0.3800.58
    • Firefox 149.0

Suggested Solutions

Render the multiplicity once on self reference. The LabelText does render once for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions