prisma-erd-generator icon indicating copy to clipboard operation
prisma-erd-generator copied to clipboard

Make ERD diagram more user friendly

Open cjoecker opened this issue 3 years ago • 3 comments

Right now the diagrams are looking good. Nevertheless, I think they would be easier to understand with the following changes: image

What do you think? I can try to make a PR for that if you like it

cjoecker avatar Aug 05 '22 10:08 cjoecker

I would agree that’s easier to read. It could potentially save some space as well. Yeah make a PR and I’ll review

keonik avatar Aug 08 '22 11:08 keonik

I was checking mermaid and there are not too many possibilities for customizing. But we can achieve that with graphviz and handlebars. The logic may change but the end result will be the same.

Here is a list of pros and cons of doing so:

  1. We can customize the diagram using HTML and CSS preserving .svg as the output
  2. At a later stage we can allow importing custom templates. That gives the user the possibility to style the diagram as they wish.
  3. It would not be 100% UML conform. The relationships need to be done as it is done in dbml diagrams (1,N on top of the lines next to the attributes). That is a pro for me as they are easier to read as UMLs.
  4. It is not an out-of-the-box solution as a mermaid for ERD diagrams.
  5. The default mermaid styles will not be there anymore (but they are not so nice anyway 😅)

What do you think? Would you be ok to switch the render engine?

cjoecker avatar Aug 08 '22 12:08 cjoecker

I'm open to it. Especially if someone has an interest in sending a PR my way. There is a discussion about moving to something other than mermaid already #102

keonik avatar Aug 18 '22 03:08 keonik

I did the best I could with mermaid's limitations. I couldn't put the key next to the string attribute or the type for some reason. What I did was combined the last column to show ❓ for nullable and 🗝️ for PK's

Screenshot 2023-03-27 at 11 00 51 PM

commit for reference

keonik avatar Mar 28 '23 03:03 keonik

@cjoecker We should keep the conversation going for dbml/graphviz alternatives. I can easily tack on a branch for a variant of this repository.

keonik avatar Mar 28 '23 03:03 keonik