python_mermaid icon indicating copy to clipboard operation
python_mermaid copied to clipboard

The `hexagon` node shape is not rendered properly

Open philiporlando opened this issue 1 year ago • 1 comments

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

philiporlando avatar Sep 16 '24 23:09 philiporlando

Nice catch ! If you have the time to investigate the bug, I'll be happy to let you do a PR to correct it, as I'm not actively correcting bugs as of now.

Dynnammo avatar Sep 18 '24 21:09 Dynnammo

@philiporlando seems to be fixed in #35 , I let you recheck

Dynnammo avatar Jun 04 '25 18:06 Dynnammo

Looks great! Thank you for fixing this!

philiporlando avatar Jun 09 '25 17:06 philiporlando