The community member has created a flowchart using Mermaid, which is slightly larger than the output cell. When they use the .center() method, the chart gets smaller to fit in the cell. The community member is unsure if this is a desired behavior or a bug.
In the comments, other community members suggest that the behavior may be related to the recent upgrade to Mermaid v11, and that the chart may be at the cutoff of being too tall, causing the centering to change the padding slightly. One community member suggests sharing a screenshot to better understand the issue.
mo.mermaid( """ flowchart TD B[B] B --> CC] C --> D[D] D --> E[E] E --> F[F] F --> G[G] G --> H[H]
%% Define a class for rounded rectangles with transparent fill classDef roundedRect fill:transparent, stroke:#333, stroke-width:3px, rx:10, ry:10;
%% Apply the class to all nodes class A,B,C,D,E,F,G,H roundedRect; """ )
which is slightly larger than the output cell. When I use the .center() method, the chart gets smaller to fit in the cell. Is it a desired behavior, or a bug?
maybe its right at the cuttoff of being too tall. and when we center something, we wrap it in another <div> so maybe the extra html DOM element just happens to change the padding so slightly