-
Notifications
You must be signed in to change notification settings - Fork 56
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
Replace Mermaid #102
Comments
Also #104 |
We've seen a considerable amount of disk space occupied bij the installed npm package of Mermaid cli.
|
@cjoecker Share a PR whenever you have it in a good spot. I think it looks way better already. Would be interested to see how it handles the huge schema's in the test cases in the repo. |
#129 special character limitation. Overlap with a regex problem but when I fix it it will cause failures at the mermaid mmdc step |
Mermiad has a big advantage, generated diagrams could be embedded to markdown files and github, for example, could render them. So I think it worth not to "replace" but maybe add some alternative. Maybe it could be done by creating some kinda plugins. The main module will be responsible for parsing prisma schema and returning some structure that could be later transform to graph. |
@keonik I created a draft PR with the proof of concept for Graphviz. Let me know what you think so that I can start the refactoring, tests fix etc. @SkeLLLa you have a good point about the embedded diagrams in the markdown files I haven't thought about. Diagrams can also be embedded and rendered as SVG files. So, whenever the schema is generated, the old SVG will be replaced and the markdown files are updated automatically 👏🏻 |
@keonik did you see the pull request? What do you think? |
I gave it a shot running locally and had a few TypeScript errors and missing imports that hung up a successful test. It says its missing |
@keonik I just pushed the missing file. It is also ok for me to have mermaid and graphviz together. This PR was just a try to see if it works. I can now do a cleaner for that. For implementing a final solution, It would be great if we have a function that gives us back the data in the following structure:
Then it would be easier to use different engines to generate the graphic. |
@cjoecker What are your thoughts on having separate branches for these representations 🤔 I just recently setup the ability to push to alpha and bravo branches that create future implementations for testing ease. I could just as easily add a graphviz branch and you would just change the install to something like this npm i -D prisma-erd-generator@graphviz |
@keonik separate branches are a good alternative. I just ask myself if it wouldn't be better to add it just as a prop in the configuration of the plugin. It is more user-friendly in my opinion. Also, if the objects and logic to produce the diagrams is clean as mentioned here, it would be super easy to use different rendering engines based on the settings props. But I struggled a bit to transform the current logic to graphviz because it was a lot of strings concatenation that was difficult to understand for me. |
Most of the issues related to this repository have been related to getting mermaid cli to generate a file. Variables that I've noticed so far are
There are also ideas for extension such as
This issue is to discuss what we would need out of a replacement. If there is enough interest maybe we could get this started
The text was updated successfully, but these errors were encountered: