mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
70.67k stars 6.33k forks source link

ER diagram without cardinality (just crowsfeet) #4777

Open jameshowison opened 1 year ago

jameshowison commented 1 year ago

Proposal

The ER diagram is great. For teaching, I like to use ER diagrams with just straight lines and the crows foot, avoiding the minimum cardinality and optionality.

(why? I find these add complexity for students who are learning where foreign keys go, and these elements of modeling don't impact relational table/column layout).

I know this is also not available in PlantUML notation, so it might be tricky. But perhaps just dropping the 0 and | parts or the relationships? Or adding a - to indicate not including either the one or the 0

Equally one could argue for just adding to the aliases one and many (where one is rendered as a | through one end of the line, I could definitely work with that rather than the empty line ending).

I guess I'd like to have the full set of options depicted in the lower half of https://www.vivekmchawla.com/erd-crows-foot-relationship-symbols-cheat-sheet/

Example

Here I'm using the > or < symbol to represent a crowsfoot.

Team ---{ Player  (one to many)

Team -----------< Player
Book }--{ Genre  (many to many)

Book >----< Genre

or

Team |--{ Player  (one to many)

Team -|----------< Player

Screenshots

No response

jameshowison commented 12 months ago

I'd take a shot at implementing this, any guidance?

Palkers76 commented 12 months ago

It would be nice to have a relationship line starting from attribute/column to referenced PK & Entity Also arranging Entities and relationship lines can became messy, would be good to allow different options to arrange it