-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/117 er diagram #1308
Feature/117 er diagram #1308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! You managed to figure out how things are made in the project and made a solid effort. Much impressive!
Hey - thanks for merging. @dunning-kruger I will certainly look at the PlantUML syntax - it's a good call. Hopefully not too late to be experimenting with alternative / additional syntax. Would it be possible to open a new issue to request this pls? Actually ignore that - I can open an issue myself ! |
@spopida, thanks for implementing this! Were you planning to update the live editor as well as well or is this up to the rest of community? |
@nickolay, happy to be involved. Sure, thanks for reminding me - yes I'll definitely have a go at the live editor as well - haven't looked at it yet, but it's on my list. I want to get PlantUML syntax working first, but then that's the next thing (unless anyone else beats me to it!) |
📑 Summary
Implementation of the ability to define entity relationship diagrams and render them using the mermaid API
Resolves #117 (ER Diagram)
📏 Design Decisions
This initial implementation only supports the definition of entities, relationships, and a 'role' which enables each relationship to be labelled. The basic syntax is as follows:
Note that:
A !-?< B : has
is equivalent toB >?-! A : has
So the statement
CUSTOMER !-!< OFFICE : has
would be read as a customer has one or more offices and an office relates to one and only one customer. Other examples are:Another key decision I took was to use curved edges between nodes. This is not strictly necessary in the long run (I could make it configurable), but I took a lot of care to make sure the crows feet meet nodes 'neatly', even when the relationship edge is intersecting with the node at an angle. I think the curved 'toes' on the crows feet look good, and go well with curved lines. But it's true that most ER diagrams have straight lines with right-angled changes of direction so that the crows feet always strike an entity squarely. I'm not sure if I can achieve this with the layout engine, so for now I have used curved lines.
I have taken the approach of using ER diagramming as a modelling tool, rather than attempting to reverse-engineer an ER diagram from a physical relational DB schema. This, of course is also possible, but represents a different problem space, and I wanted to tackle the modelling domain.
I have explored the rest of the codebase at length and tried to follow the right approach, but pretty much all the technology involved is new to me, so I am totally receptive to any constructive suggestions to improve things - and grateful for the opportunity to contribute!
📋 Tasks
Make sure you
develop
branch