Reference
ts
import { layoutOf, readingOrder, toSvg } from '@adecore/diagram';
import { diagramProblemIn, migrateDiagram, type DiagramDocument } from '@adecore/diagram/protocol';Limits and constants
| Name | Value | Explained in |
|---|---|---|
DIAGRAM_VERSION | 1 | Documents |
DIAGRAM_LIMITS | { nodes: 100, edges: 120 } | Documents |
DIAGRAM_SHAPES | rect, round, pill, diamond, cylinder | Documents |
LABEL_SIZE | 14 | Layout |
SUB_SIZE | 12 | Layout |
GROUP_LABEL_BAND | 24 | Layout |
DEFAULT_NODE_TONE | ink | Export to SVG |
DEFAULT_GROUP_TONE | muted | Export to SVG |
DEFAULT_EDGE_TONE | muted | Export to SVG |
The DiagramSvgOptions are on Export to SVG.
Exports
Every name each entry point exports, read from its source. Anything not listed is internal and may change in any release.
@adecore/diagram
The layout, the SVG export, the painter helpers and reading order.
| Name | Kind | Source |
|---|---|---|
NodeBox | type | layout |
GroupBox | type | layout |
EdgeLabelBox | type | layout |
EdgeRoute | type | layout |
DiagramLayout | type | layout |
GROUP_LABEL_BAND | const | layout |
layoutOf | function | layout |
Point | type | layout |
Rect | type | layout |
LABEL_SIZE | const | text |
SUB_SIZE | const | text |
readingOrder | function | reading-order |
ShapePaths | type | shapes |
shapePaths | function | shapes |
TextLine | type | shapes |
textLinesOf | function | shapes |
edgeLabelLinesOf | function | shapes |
edgePath | function | shapes |
arrowHeadPath | function | shapes |
dashOf | function | shapes |
DiagramSvgOptions | type | svg |
DEFAULT_NODE_TONE | const | svg |
DEFAULT_GROUP_TONE | const | svg |
DEFAULT_EDGE_TONE | const | svg |
toSvg | function | svg |
@adecore/diagram/protocol
The schemas and types of a diagram, migrateDiagram and diagramProblemIn. Loads Zod and the drawing protocol.