Closed janpio closed 2 years ago
@janpio I tried to write a test with your schema and it was throwing unrelated issues when it came to parsing the data model into a string before getting to mermaid cli. If the prisma-erd-generator@next
version fixes your issues let me know.
With prisma-erd-generator@next
I can indeed generate an ERD. Has a lot of unnecessary whitespace around it, but there is a graph.
@janpio included in v0.8.1
.
@all-contributors please add @janpio for finding a bug
@keonik
I've put up a pull request to add @janpio! :tada:
I still get this error on "prisma-erd-generator": "^1.11.0"
and "@mermaid-js/mermaid-cli": "^10.3.1"
,. I looked at #50 and saw that the size was hard-coded
Is there a way to override this and increase it even more with a mermaid config?
EDIT: I used tableOnly
to see if I could get an erd to generate. I was able to generate one, but it is so large its not usable when browsing the svg in chrome.
We have multiple schemas in Prisma. I think what I really need is a way to only generate an ERD for a particular schema, then generate multiple erd diagrams so they can be viewed separately
Is the problem the size of the SVG?
if its just text size you can configure it in the mermaid config
/** @type {import('mermaid').MermaidConfig} */
const config = {
deterministicIds: true,
maxTextSize: 90000,
er: {
/**
* When this flag is set to `true`, the height and width is set to 100%
* and is then scaled with the available space.
* If set to `false`, the absolute space required is used.
*
*/
useMaxWidth: true,
},
theme: process.env.THEME,
};
module.exports = config;
In the example above you could also play around with the useMaxWidth flag and use that to play with width/height if its more a scale issue
When creating a diagram for the following Prisma schema (via https://github.com/prisma/prisma/issues/10856#issue-1088186269) I get a "Maximum Text Size In Diagram Exceeded" instead of a real diagram:
Seems this is configurable: https://stackoverflow.com/a/63168255