Skip to content
glyphcss

ASCII diagram node shape catalogue

Use a JSON node’s shape field, or Mermaid’s N@{shape: doc, label: "Read item"}. These examples use JSON so the exact public shape name appears beside its output. Shapes carry meaning through outlines, independent of color.

           ┌──────┐           
           │ rect │           
           └──────┘           
rect
         ╭─────────╮          
         │ rounded │          
         ╰─────────╯          
rounded
        ╭───────────╮         
        │ ◆ diamond │         
        ╰───────────╯         
diamond
          ◜◠◠◠◠◠◠◠◠◝          
          │ circle │          
          ◟◡◡◡◡◡◡◡◡◞          
circle
       ┌──────────────┐       
       ││ subroutine ││       
       └──────────────┘       
subroutine
        ┌────────────╲        
        │ asymmetric │        
        └────────────╱        
asymmetric
         ◜─────────◝          
         │ stadium │          
         ◟─────────◞          
stadium
         ◜──────────◝         
         │ cylinder │         
         ◟──────────◞         
cylinder
              *               
point
       ┌─────────────┐        
       │ compartment │        
       ├─────────────┤        
       │ +id: string │        
       ├─────────────┤        
       │ +save()     │        
       └─────────────┘        
compartment
          ╭◠◠◠◠◠◠◠╮           
          │ cloud │           
          ╰◡◡◡◡◡◡◡╯           
cloud
           *╱╲╱╲╱╲*           
           │ bang │           
           *╲╱╲╱╲╱*           
bang
         ╱─────────╲          
         ❬ hexagon ❭          
         ╲─────────╱          
hexagon

Catalogue names below work in JSON and in Mermaid shape metadata.

          ┌───────┐           
          │  doc  │           
          ╰◡◡◡◡◡◡◡╯           
doc
           ┌──────┐           
          ┌──────┐│           
          │ docs │┘           
          ╰◡◡◡◡◡◡╯            
docs
          ┌─────────┐         
         ┌─────────┐│         
         │ st-rect │┘         
         └─────────┘          
st-rect
        ┌───────────┐         
        │ tag-doc ◇ │         
        ╰◡◡◡◡◡◡◡◡◡◡◡╯         
tag-doc
         ╱───────────┐        
        ╱ notch-rect │        
        └────────────┘        
notch-rect
         ┌──────────┐         
         ├ div-rect ┤         
         └──────────┘         
div-rect
        ┌─┬──────────┐        
        │ │ lin-rect │        
        └─┴──────────┘        
lin-rect
        ┌────────────┐        
        │ tag-rect ◇ │        
        └────────────┘        
tag-rect
           ╱────────╱         
          ╱ lean-r ╱          
         ╱────────╱           
lean-r
         ╲────────╲           
          ╲ lean-l ╲          
           ╲────────╲         
lean-l
         ────────────         
         ╲  trap-t  ╱         
          ╲────────╱          
trap-t
          ╱────────╲          
         ╱  trap-b  ╲         
         ────────────         
trap-b
        ╱────────────╲        
       │  notch-pent  │       
       └──────────────┘       
notch-pent
          ┌───────╮           
          │ delay │           
          └───────╯           
delay
         ╲──────────╱         
          )bow-rect(          
         ╱──────────╲         
bow-rect
         ╱──────────╮         
        ( curv-trap │         
         ╲──────────╯         
curv-trap
              ╱╲              
             ╱  ╲             
            ╱    ╲            
           ╱ tri  ╲           
           ────────           
tri
         ────────────         
         ╲          ╱         
          ╲        ╱          
           flip-tri           
            ╲    ╱            
             ╲  ╱             
              ╲╱              
flip-tri
        ╲───────────╱         
         )hourglass(          
        ╱───────────╲         
hourglass
         ┌─────────┐          
         │ ╲╱ bolt │          
         └─────────┘          
bolt
           ╭◠◠◠◠◠◠╮           
           │ flag │           
           ╰◡◡◡◡◡◡╯           
flag
        ╔════════════╗        
        ║( dbl-circ )║        
        ╚════════════╝        
dbl-circ
        (╳) cross-circ        
cross-circ
        ┌───┐                 
        │ ○ │ fr-circ         
        └───┘                 
fr-circ
           ● f-circ           
f-circ
          ○ sm-circ           
sm-circ
          ╭───────┬╮          
          │ h-cyl ││          
          ╰───────┴╯          
h-cyl
        ┌───────────┐         
        ├───────────┤         
        │ lin-cyl   │         
        ├───────────┤         
        └───────────┘         
lin-cyl
        ─────────────         
          datastore           
        ─────────────         
datastore
         ◜◠◠◠◠◠◠◠◠◠◠◝         
         ╲  bucket  ╱         
          ╰────────╯          
bucket
             text             
text
          ━━━━━━━━━           
             │                
fork
           ╭                  
           ┤ brace            
           ╰                  
brace
                   ╮          
           brace-r ├          
                   ╯          
brace-r
          ╭        ╮          
          ┤ braces ├          
          ╰        ╯          
braces
        ┌───────────┐         
        │ ○ browser │         
        └───────────┘         
browser
        ┌───────────┐         
        ├───────────┤         
        │ $ console │         
        └───────────┘         
console
              ○               
          ╭────────╮          
          │ person │          
          ╰────────╯          
person

ascii uses simpler outlines. Box, blocks, and braille hexagons use ❬ and ❭ sides; ASCII uses angle brackets. Clouds and bangs also have ASCII outlines.

         /----------\         
         < Decision >         
         \----------/         
Code
import { renderGlyphDiagram } from "@glyphcss/diagrams";

const { text } = await renderGlyphDiagram({
  direction: "LR",
  nodes: [
    {
      id: "n",
      label: "Decision",
      shape: "hexagon"
    }
  ],
  edges: []
}, {
  target: "chat",
  charset: "ascii",
  width: 30,
  height: 9
});
console.log(text);

Use Glyph Mono for special glyphs in web output; chat uses the receiving application’s font. See fonts and fallbacks.

Catalogue shapes reserve their full footprint and attach edges away from seams. point draws the first character of its required nonempty label and cannot have a direct JSON self-edge. fork draws an unlabelled bar/stub; a supplied label goes below it. compartment accepts member rows.

Mermaid names lin-doc, win-pane, sl-rect, and folder have logged adaptations; they are not additional JSON shape values. External icons and images are inert. Inspect render notes when fitting changes an outline or label.