mermaid: Layered Blocks Layout

Is your feature request related to a problem? Please describe.

I would prefer to describe APIs and such in terms of layered rectangles, rather than have a scattered array of boxes and curvy arrows.
It makes diagrams easier for me to read, plus this would be very useful for an API Layer diagram, to make it obvious that entity X is part of the foundational layer, where it consumes no other types. Then something at the top layer could all below it.

E.g. something like this, without the description bubbles on the left column. But with the connecting arrows, if desired.

image

Describe the solution you’d like

When working with (say) a class diagram. It would be nice if there was a way to apply an attribute to say that it was part of layer N. This might require an attribute of classDiagram that would be similar to direction such as layout LAYERS or something. The renderer would then create an encompassing rectangle around all classes of the same layer, and the encompassing rectangle would be stacked according to its relative number.

Describe alternatives you’ve considered

Presently, I think the class diagram is useful for describing dependencies, and the c4 diagram are the closest for providing encompassing rectangles, but neither seem to offer the ability to use a stacked rendering method instead of a graph solver with arrows.

** Additional Context **

Additional examples:

image

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@Yokozuna59 I think we can give it a shot

@nirname Perhaps a call to work this out.