Skip to content

Mermaid scaling issue in LR diagrams #6697

@sghng

Description

@sghng

Describe the bug

In LR orientation, the texts in Mermaid diagrams don't scale. TD orientation works fine.

Image

Will you submit a PR?

  • Yes

Environment

{
  "marimo": "0.16.5",
  "editable": false,
  "location": "/Users/sghuang/mamba/envs/ds/lib/python3.13/site-packages/marimo",
  "OS": "Darwin",
  "OS Version": "25.0.0",
  "Processor": "arm",
  "Python Version": "3.13.7",
  "Locale": "en_US",
  "Binaries": {
    "Browser": "141.0.7390.55",
    "Node": "v24.9.0"
  },
  "Dependencies": {
    "click": "8.3.0",
    "docutils": "0.22.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.9",
    "narwhals": "2.6.0",
    "packaging": "25.0",
    "psutil": "7.1.0",
    "pygments": "2.19.2",
    "pymdown-extensions": "10.16.1",
    "pyyaml": "6.0.3",
    "starlette": "0.48.0",
    "tomlkit": "0.13.3",
    "typing-extensions": "4.15.0",
    "uvicorn": "0.35.0",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "altair": "5.5.0",
    "duckdb": "1.4.0",
    "nbformat": "5.10.4",
    "openai": "2.1.0",
    "pandas": "2.3.3",
    "polars": "1.34.0",
    "pyarrow": "21.0.0",
    "loro": "1.8.1",
    "pytest": "8.4.2",
    "python-lsp-ruff": "2.3.0",
    "python-lsp-server": "1.13.1",
    "ruff": "0.13.3",
    "sqlglot": "27.20.0"
  },
  "Experimental Flags": {
    "external_agents": true,
    "performant_table_charts": true,
    "inline_ai_tooltip": true
  }
}

Code to reproduce

mo.mermaid(
    r"""
    graph LR
        A[Select template, model, # of items]
        B[Model generates item]
        C[Models review item]
        D[Check and submitted generated item]
        E[Assign generated items to expert for review]
        A --> B --> C --> D --> E
    """
).center(),

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions