mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Filter duplicate relationships in erDiagram

Open sualeh opened this issue 4 years ago • 1 comments

Description of Issue The ER diagram needs to filter out duplicate relationships when the relationship is defined in reverse. (ER diagram already filters out duplicate relationships in the same order.)

To Reproduce Define an ER diagram like this:

erDiagram
	CUSTOMER }|..|{ DELIVERY-ADDRESS : has
	CUSTOMER ||--o{ ORDER : places

	CUSTOMER ||--o{ INVOICE : "liable for"
	CUSTOMER ||--o{ INVOICE : "liable for"
	INVOICE }o--|| CUSTOMER : "liable for"
        CUSTOMER ||--o{ INVOICE : "liable for also"

Expected behavior Even though the "liable for" relationship (CUSTOMER -> INVOICE) is defined 3 times, it should be shown only once.

Desktop (please complete the following information):

  • Browser: Chrome
  • https://mermaid-js.github.io/mermaid-live-editor

sualeh avatar Jul 14 '20 10:07 sualeh

Hi @sualeh - thanks for your submission.

I think you have identified an issue worth investigating. It's quite easy to avoid, of course, but it seems like a fair point to me.

spopida avatar Jul 15 '20 07:07 spopida