-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Too many edges error #5042
Comments
I also got this error in the online editor and CLI on mac. After using a similar hack mmdc generates an image just fine. This would be better if if was a config parameter. My mmd graph file was 11kb, 531 lines sudo vi /usr/local/lib/node_modules/@mermaid-js/mermaid-cli/dist/index.html |
@mken418 how did you generate the image using mmdc? I tried to change that value from 280 to 2000 as well but it doesn't work for me. I'm on Windows 11 though. I tried both, converting a markdown file which contains a diagram and a *.mmd file as well. I tried using this: Chaning the value to Thanks |
I just downgrade to 10.5.0 and it helps. The limit 280 is hardcoded. There is no way to change it. |
Same issue here, even mermaid.initialize with setting maxTextSize ignores the value. |
fc28c1d was where the check was added. This limit should be increased, and be made configurable. @pbrolin47 you were facing the same issue from another user report right? |
Hello, I tried to create a diagram with 750 points and I have the same message. |
@DefamationStation are diagrams with that many edges a common scenario? Also, are you using mermaid.live for this? |
Hello It's not the standard but I've got some scenarios where I am using a lot of nodes to plot routes throughout cities! Yes mermaid.live Thats very good to hear thank you! |
feat #5042: Add `flowchart.maxEdges` config.
Hi - is there anyway to configure this with the mermaid CLI, or the jetbrains plugin? I tried using -c [configfile] but still get the error (with version 10.6.1). frontmatter config doesn't seem to work either. I have ~750 lines of graph LR in the markdown file... cat .stats.mermaid.json {
"maxEdges": 1000
} npx @mermaid-js/mermaid-cli -c .stats.mermaid.json -i .stats.mermaid.md -o .stats.diagram.svg
Found 1 mermaid charts in Markdown input
Error: Evaluation failed: Error: Too many edges
at dbt (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:103:13448)
at Object.Fbt [as addLink] (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:103:13584)
at Object.performAction (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:98:6972)
at Lh.parse (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:100:892)
at PUt.parse (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:64:512)
at new PUt (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:64:247)
at GjA (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:64:824)
at async Object.N2e [as render] (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/dist/index.html:87:1146)
at ExecutionContext._ExecutionContext_evaluate (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:254:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:143:16)
at async CDPJSHandle.evaluate (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js:56:16)
at async CDPElementHandle.$eval (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:86:24)
at async renderMermaid (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/src/index.js:246:22)
at async file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/src/index.js:442:41
at async Promise.all (index 0)
at async run (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/src/index.js:461:22)
at async cli (file:///Users/mlandis/.npm/_npx/668c188756b835f3/node_modules/@mermaid-js/mermaid-cli/src/index.js:184:3)= |
mermaid.txt
Description
When a flowchart becomes large, Mermaid dismisses the graphing and fails with a "Syntax error" splash. The JS console tells "Too many edges" from mermaid.min.js related to the MPt function, which occurs if something (number of edges ?) to be higher than 280.
MPt = function(i, a, f) { const m = { start: i, end: a, type: void 0, text: "", labelType: "text" }; Ut.info("abc78 Got edge...", m); const b = f.text; if (b !== void 0 && (m.text = cY(b.text.trim()), m.text[0] === '"' && m.text[m.text.length - 1] === '"' && (m.text = m.text.substring(1, m.text.length - 1)), m.labelType = b.type), f !== void 0 && (m.type = f.type, m.stroke = f.stroke, m.length = f.length), (m == null ? void 0 : m.length) > 10 && (m.length = 10), gk.length < 280) Ut.info("abc78 pushing edge..."), gk.push(m); else throw new Error("Too many edges")
Attached the Chrome consol log
sbm-v1.agharen.fr-1700294922137.log
Steps to reproduce
Create a large flow chart, if big enough, the issue will occur.
The problem seems to occur above a 50 Kb script, the attached file is 84 Kb, 1200 lines, 300-400 edges.
Current initialization:
mermaid.initialize({startOnLoad:true, logLevel: 1, theme: 'neutral', maxTextSize: 5000000, MAX_CHAR_LIMIT: 5000000 });
Screenshots
No response
Code Sample
No response
Setup
Suggested Solutions
Increase significantly this limitation or make it adjustable.
I am now using successfully a local copy of mermaid.min.js with that number increased from 280 to 2000
Additional Context
No response
The text was updated successfully, but these errors were encountered: