mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.2k stars 207 forks source link

$c4ShapeInRow not counting per row #704

Open ellipticview opened 2 weeks ago

ellipticview commented 2 weeks ago

It is expected that $c4ShapeInRow determines the max shapes in a single row.

The behavior seems to be counting across boundaries instead of for a single row.

To Reproduce

    C4Context
      title System Context diagram
      Enterprise_Boundary(A, "A") {
        System(a1, "System a1")
        System(a2, "System a2")

      }
      Enterprise_Boundary(B, "B") {
        System(b1, "System b1")
        System(b2, "System b2")
        System(b3, "System b3")
        System(b4, "System b4")
      }

      UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1")

image

Expected behavior Systems b1-b4 in one row.

Note, if we increase the value of $c4ShapeInRow to 6, then b1-b4 are displayed in one row.

    C4Context
      title System Context diagram
      Enterprise_Boundary(A, "A") {
        System(a1, "System a1")
        System(a2, "System a2")

      }
      Enterprise_Boundary(B, "B") {
        System(b1, "System b1")
        System(b2, "System b2")
        System(b3, "System b3")
        System(b4, "System b4")
      }

      UpdateLayoutConfig($c4ShapeInRow="6", $c4BoundaryInRow="1")

image