Open jthomerson opened 3 years ago
This issue might have some similarity to the feature request in #550. I think the bug could be fixed without implementing the feature, but the feature could also give folks more control and eliminate the bug - because I could specify BT in the top "root" graph, and LR or RL or BT etc in each subgraph.
Describe the bug I'm building an open source tool that helps manage and visualize dependencies between microservices. I'm using a flowchart to represent the dependencies between services, and services are in systems. Each system is a subgraph. There's also a special subgraph called "root" that has root dependencies that must be deployed before any other service.
When I use
flowchart BT
to get the root dependencies at the top of the graph (all dependencies point "up" to root), everything works great, except the dependencies within the root subgraph go top-to-bottom.To Reproduce
Use this graph:
This is how it renders:
Expected behavior I would expect
root-resources
to be on the top since this is aBT
chart. For example, I would expect it to look like this:Notably, a tweak to make each subgraph depend on the last dependency in the root subgraph (rather than depending on the root subgraph itself) fixes the problem. Here's the adjusted Mermaid:
Those last four lines are the ones that changed. Here's the result. It gets the dependency direction correct, but makes the root subgraph look awful because the box becomes very large. That's why I'd rather just link the subgraphs rather than items in each subgraph.
Thanks for the awesome library! Let me know if more info would be helpful. I used the Mermaid Live Editor to produce these diagrams, at version 8.8.0.