paint(
frame,opts) ->svg
Paint a frame as one SVG string
Returns one string, from <svg to </svg>. It is also a whole SVG file.
opts:
| Field | Holds |
|---|---|
cell_w, cell_h | a cell's size in user units; 10 by 20 when not given |
One user unit is one CSS pixel at the picture's own size. The root's
width and height give that size, and its viewBox lets a stylesheet
shrink it. A stroke is a tenth of cell_h, the font eight tenths.
The paint order is the frame's: groups, boxes, routes and their markers,
then the texts in one <g>.
| Element | Class |
|---|---|
| the root | diagram-flowchart or diagram-sequence, by frame.kind; none for a frame with no kind |
| a group, a box, a route, a text | diagram- and its style, each dot a dash |
| a marker | its route's class and diagram-marker |
The root names the picture for a reader who cannot see it. With
frame.title, the root is role="img" and its aria-label is the
title: a screen reader reads the title and skips the labels. With no
title, the root has no role and its aria-label is the kind's name, or
diagram: the labels are read as text. frame.descr, when there is
one, is a <desc>, the root's first child. There is no <title>
element: a browser shows one as a tooltip over the whole picture.
The frame must pass mermaid.frame.check. The painter raises nothing on
a checked frame.