Diagrams

Mermaid diagrams

marimo.mermaid(diagram: str) Html

Render a diagram with Mermaid.

Examples.

diagram = '''
graph LR
    A[Square Rect] -- Link text --> B((Circle))
    A --> C(Round Rect)
    B --> D{Rhombus}
    C --> D
'''
mo.mermaid(diagram)

Mermaid is a tool for making diagrams such as flow charts and graphs. See the Mermaid documentation for details.

Args.

  • diagram: a string containing a Mermaid diagram

Returns.

  • An Html object.

Statistic cards

marimo.stat(value: str | int | float, label: str | None = None, caption: str | None = None, direction: Literal['increase', 'decrease'] | None = None, bordered: bool = False) Html

Display a statistic.

Optionally include a label, caption, and direction.

Args.

  • value: the value to display

  • label: the label to display

  • caption: the caption to display

  • direction: the direction of the statistic, either increase or decrease

  • bordered: whether to display a border around the statistic

Returns.

An Html object representing the statistic.