Skip to content

The hexagon node shape is not rendered properly #32

@philiporlando

Description

@philiporlando

This reprex shows that shape = "hexagon" is translating to Mermaid as {{)} instead of {{}}, which results in a rendering error:

from python_mermaid.diagram import Link, MermaidDiagram, Node

# Family members
meg = Node("Meg", shape="hexagon")
jo = Node("Jo")
beth = Node("Beth")
amy = Node("Amy")
robert = Node("Robert March")

the_march_family = [meg, jo, beth, amy, robert]

# Create links
family_links = [
    Link(robert, meg),
    Link(robert, jo),
    Link(robert, beth),
    Link(robert, amy),
]

chart = MermaidDiagram(title="Little Women", nodes=the_march_family, links=family_links)

print(chart)
---
title: Little Women
---
graph
meg{{"Meg")}       
jo["Jo"]
beth["Beth"]       
amy["Amy"]
robert_march["Robert March"]
robert_march ---> meg
robert_march ---> jo
robert_march ---> beth
robert_march ---> amy
Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions