mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Unicode symbol syntax in flowchart/graph: "u:u-gear" -> ⚙

Open ioggstream opened this issue 2 years ago • 2 comments

Proposal

I wish

  • to reference unicode symbols by name in mermaid. This will improve diagram interoperability without relying on external fonts.

Note

In python3.11 you can do it

print("This is a \N{GEAR}. Now a \N{DOTTED SQUARE}.")

'This is a ⚙. Now a ⬚'

Example

graph

A["This is a u:u-gear"] -->|will render as| B["This is a ⚙"]
C["A u:u-dotted-square"] -->|will render as| D["A ⬚"]

Screenshots

No response

ioggstream avatar Feb 24 '23 14:02 ioggstream

~~@ioggstream, is there a standard list of name -> unicode mapping available somewhere?~~

Python seems to be using data from https://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt

sidharthv96 avatar Feb 24 '23 14:02 sidharthv96

@sidharthv96 yes, that's it. I used https://unicode.org/Public/UNIDATA/Index.txt This is a js package too https://www.npmjs.com/package/unicode (but I never used it).

ioggstream avatar Feb 24 '23 15:02 ioggstream

Hi! Can I pick this up?

SillyCoon avatar Mar 28 '23 23:03 SillyCoon