Skip to content
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/1309 er diagram plant uml #1324

Merged
merged 2 commits into from
Mar 30, 2020

Conversation

spopida
Copy link
Member

@spopida spopida commented Mar 29, 2020

📑 Summary

Alters the syntax for newly implemented ER diagrams so that it is compatible with PlantUML ERD syntax

Resolves #1309

📏 Design Decisions

A fairly straight-forward change to the jison parsing logic to use different syntax for specifying relationships between entities. For example, the original syntax I implemented for an one-to-many was EntityA !-?< EntityB : label and the new syntax for this is EntityA ||--o{ EntityB : label.

The : label part is an extension to PlantUML, because it is very convenient/common to label relationships.

Also PlantUML syntax allows the distinction between identifying and non-identifying relationships which I hadn't previously implemented. This is now supported by using either hyphens or dots in the middle part of the relationship specifier. Hyphens are rendered as a s solid line, whereas dots are rendered as a dashed line. The docs have been updated to give a better overview.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

Copy link
Collaborator

@knsv knsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet another improvement!

@knsv knsv merged commit 8fede48 into mermaid-js:develop Mar 30, 2020
@vitonextworld
Copy link

It appears that there is no way to model the entity itself, specify attributes for a particular entity. Is that correct? Am I missing something in the syntax?

@spopida
Copy link
Member Author

spopida commented Mar 31, 2020

@vitonextworld you are correct - at the moment there is no way to specify attributes. This is a basic implementation to model the entities and relationships themselves. There are lots of extras that could be implemented in time.

@spopida spopida deleted the feature/1309_erDiagram_PlantUML branch April 1, 2020 08:02
72636c added a commit to 72636c/mermaid that referenced this pull request Jul 11, 2020
This restores the option of rendering an ERD with an absolute width,
which is consistent with the approach taken with the other diagram
types.

This logic was lost in mermaid-js#1324, which was probably just a small oversight:

mermaid-js@9199546#diff-7c38d27acbe0676d923bf19283671616L397-L409

The option defaults to true for backwards compatibility.
@72636c 72636c mentioned this pull request Jul 11, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider offering syntax like PlantUML for ER diagrams
3 participants