mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.98k stars 6.53k forks source link

Misc. rendering errors for stateDiagram-2: TB bias, self-referring links, etc. #5827

Open sjn opened 1 month ago

sjn commented 1 month ago

Description

I'm working on (and have published) a couple of stateDiagrams that seem to be broken with the v11.1.0 renderer.

Found:

You can find them "live" here: https://github.com/CPAN-Security/security.metacpan.org/blob/supplychain-sbom/docs/supplychain-sbom.md (using v11.1.0 as of 2022-09-06)

Expected:

This diagram differs in many ways from the "live" one, which uses the v10.0.9 renderer: https://security.metacpan.org/docs/supplychain-sbom.html#open-source-supply-chain-full-diagram

Regressions:

Apologies for using my own terms here; I hope you can still use this to figure out what I mean

Steps to reproduce

Please see the guthub source of the pages linked above: https://github.com/CPAN-Security/security.metacpan.org/blob/supplychain-sbom/docs/supplychain-sbom.md?plain=1#L203-L378

Screenshots

Expected:

image

Found:

image image

Code Sample

No response

Setup

Suggested Solutions

No response

Additional Context

No response

sjn commented 1 month ago

BTW, when I say the self-referring links look "boxy", I'm comparing it to these:

image

They look a LOT nicer, and the only gripe I have with them is that in a top-bottom direction biased diagram, I expect the "exits" to be at the bottom of the node, and the "entrances" be on the top – meaning that the directionality of the arrow has a bias/preference for going from the bottom of the originating box to the top of the target box – including if the arrows are targeted at the originating box (meaning, they are self-referring).

I hope that makes sense? :-)

(I've updated the OP with this)

knsv commented 1 month ago

@sjn Thanks for reporting. We are publishing a hotfix as soon as possible. I have checked that your diagram will render after the hotfix. I agree that the self-loops look a bit boxy, and we will try to fix them in a future release.

Relates #5820, #5822

sjn commented 1 month ago

Is there a chance that any of the other rendering buts will be addressed soon? I'm noticing that more people are upgrading, which makes this a bit more difficult for me who would like to be able to present clear flowcharts (without strange rendering oddities).

Is there anything I can do to assist?