Topic on Extension talk:Flex Diagrams

Problems with large graphs

6
Tenbergen (talkcontribs)

I did some more work on generating mermaid code from Cargo for an org chart. This generated ~1500 lines of code. I ran into two problems. Initially I got an error that there was too much text (sorry I didn't take it down verbatim). I shortened the annotations in my links (which don't show up anyway, btw), and that error went away and I was able to save the mermaid: page. But when I now try to open it from a page with {{#display_diagram:Mermaid:...}} I get a "Syntax error in graph" (even though the page works on the mermaid:... page). I wonder if they use different size string variables or something. So, there are size limitations to this, which is reasonable, the huge graphs aren't very easy on the eyes anyway. But: it would be great to know what the limitations actually are. And I still think it would be awesome if this was able to take query output from Cargo directly - I now have a setup where I manually copy-paste it from Cargo output to the Mermaid page.

Yaron Koren (talkcontribs)

I didn't know there were problems with handling overly-large text, with either Flex Diagrams or the Mermaid library itself. What was the initial error message? That would be helpful to know - especially to know whether the error comes from FD or Mermaid.

Tenbergen (talkcontribs)

The error is "Maximum text size in diagram exceeded"; if I paste it into https://mermaid.live I get the same error, so that's Mermaid not FlexDiagrams. A somewhat smaller version of the code will display fine in the mermaid:... page, but not when called with {{#display_diagram:Mermaid:...}}. That one just gives a "syntax error in graph" with that bomb icon, which is what it would do if code was cut in mid command, so I wonder if there is a variable size problem. Debug log near mention of mermaid is

[objectcache] fetchOrRegenerate(global:SqlBlobStore-blob:intmedmw-mw_:tt%3A37700): miss, new value computed
[ContentHandler] Registered handler for flexdiagrams-mermaid: FDMermaidContentHandler
[objectcache] fetchOrRegenerate(intmedmw-mw_:preprocess-hash:880fce3f791fe26f617801db0e5458476e9e8ce4:0): miss, new value computed
Yaron Koren (talkcontribs)

Sorry, I missed this before. The caching failure seems unrelated to the syntax error, but I don't know anything beyond that. This may be outside of the ability of the Flex Diagrams code to fix.

Tenbergen (talkcontribs)

So whatever variable type is used for the {{#display_diagram tag is not smaller than the one on the mermaid:... page?

Yaron Koren (talkcontribs)

I don't think so... it's the same code that handles display in both places, if I remember correctly.

Reply to "Problems with large graphs"