rrk
rrk

Reputation: 1

Maximum text size in diagram exceeded- mermaid.js

I am using mermaid 8.8.1 and trying to render a large diagram and getting an error "Maximum text size in diagram exceeded". Another answer here Maximum Text Size In Diagram Exceeded recommends overriding "maxTextSize" setting, but I dont find this in the mermaidAPI configuration settings https://github.com/mermaid-js/mermaid/blob/develop/docs/Setup.md#mermaidapi-configuration-defaults. Where can I find this setting or is there another work around to fix this error?

Upvotes: 0

Views: 2866

Answers (2)

RDx
RDx

Reputation: 1

For long documents you'll receive the error "Maximum Text Size In Diagram Exceeded". This is due to mermaid limiting the diagram to 50000 characters.

Mermaid can be configured to allow a different character amount by setting maxTextSize:

In your code find where you are initializing mermain and add override for maxTextSize like this:

mermaid.initialize({
  maxTextSize: 90000
});

Upvotes: 0

Carson
Carson

Reputation: 8098

which in defaultConfig.js

const config = {
  theme: 'default',
  themeVariables: theme['default'].getThemeVariables(),
  themeCSS: undefined,
  /* **maxTextSize** - The maximum allowed size of the users text diagram */
  maxTextSize: 50000,
  // ...
}

Upvotes: 0

Related Questions