keonik / prisma-erd-generator

Generate an ER Diagram based on your Prisma schema every time you run npx prisma generate
https://www.npmjs.com/package/prisma-erd-generator
MIT License
884 stars 49 forks source link

Generated ERD's are very small since mermaid.js 10.0.2 upgrade #199

Open Notalifeform opened 1 year ago

Notalifeform commented 1 year ago

Hi,

OS: Linux bda6bb6910c4 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux Node version: v18.13.0

We upgraded to prisma-erd-generator 1.5.4 and now see that the generated ERD's are very small. I see similar behaviour in the commit below. So I suspect that is the culprit?

https://github.com/keonik/prisma-erd-generator/commit/2a6f2cb9b941c0ce083f3ae8e4de293d972fe9e5

image

keonik commented 1 year ago

This has to be related to upgrading mermaid-cli. Here are a list of the options we can pass in to configure the mermaid cli for generating this erd

keonik commented 1 year ago

I'm not sure if you can set the screen size or the min size but you can control the useMaxWidth which sets the width based on the browser screen size in puppeteer. If you set useMaxWidth: false it likely will be a scrollable svg that is huge. Let me know if you find another option in there to adjust this.

francismanansala commented 1 year ago

@keonik I think there's an issue with mermaid with a recent update, or at least with how it's being used. The relationships between tables show 2 lines:

image

keonik commented 1 year ago

I'm going to make a change that reverts it back to the mermaid cli's puppeteer config setup found here https://github.com/mermaid-js/mermaid-cli/blob/9cd061ab77c3372bd4600721bac708967b1eec66/puppeteer-config.json#L3

keonik commented 1 year ago

If the issue persists this may be an issue mermaid should have in their list.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.10.0-alpha.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.12.0-alpha.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: