Topic on Extension talk:Flex Diagrams

Tenbergen (talkcontribs)

Yaron, thanks for another excellent extension. I had tried to do data driven diagrams through the mermaid extension a while ago but that was always flaky enough that I stopped. I just set up an example of a Cargo query populating the Mermaid page for a Flex Diagram. It's a bit messy, and it would be nice if this was available as a feature (see also #Feature Request - Diagrams should support SMW/Cargo results.). But, it works, mostly. There are two problems. One is that the page shows as only an error in the diagram edit mode on the diagram page. The other is that when I edit the example page itself, when I preview the code is expanded, but the diagram is not shown. It resolves into the diagram when I save, but in preview it looks like an error. In troubleshooting I also tried to draw the code in from a template instead, but the template doesn't resolve in code either.

Tenbergen (talkcontribs)

Also, the graph doesn't get updated consistently as the data changes. I tried to refresh the graph page, and also the consuming page, but am not getting a graph with updated content as I add data.

Yaron Koren (talkcontribs)

It's impressive that you got this working! That is, generating Mermaid syntax from Cargo queries. As you have discovered, though, Flex Diagrams was not designed with this kind of dynamic generation of syntax in mind - which is why there are problems with both previewing and display. It seems to me that it would be better, for this case, to use the Mermaid extension instead - and to place all those #cargo_query calls within a #mermaid call. It's perhaps less efficient, but it will always display the correct data.

Tenbergen (talkcontribs)

I was initially trying to use the Mermaid extension, but it has some showstopper bugs as well. And: you support this one, so I have far more hope that this one gets fixed if it has problems. But I can see where I have come up with an edge case here. Is there, or could there be, a maintenance script that would cause these graphs to update, so I could just run that in a crontab? Or, better yet but probably more work, a Cargo query result format?

Yaron Koren (talkcontribs)

Sorry for the delay. And thank you, that's nice of you. I don't know if a Mermaid Cargo result format is really possible, since Mermaid is so flexible - it would be hard to capture all of the options. (I assume that's the same reason why there's no SMW Mermaid format either - though SMW does use Mermaid to display Gantt charts.) Yes, there could be a script that re-saves all of the "Mermaid:" Flex Diagrams pages, which could then be run on a nightly basis or whatever it is. I don't think an exact script like that exists, but it probably wouldn't be that hard to create one. Still, I think the real solution is to fix the Mermaid extension. It's (in theory) such a simple set of functionality that it shouldn't be too hard to get working again...

Reply to "Mermaid from Cargo"