Skip to content

Reference ​

ts
import { layoutOf, readingOrder, toSvg } from '@adecore/diagram';
import { diagramProblemIn, migrateDiagram, type DiagramDocument } from '@adecore/diagram/protocol';

Limits and constants ​

NameValueExplained in
DIAGRAM_VERSION1Documents
DIAGRAM_LIMITS{ nodes: 100, edges: 120 }Documents
DIAGRAM_SHAPESrect, round, pill, diamond, cylinderDocuments
LABEL_SIZE14Layout
SUB_SIZE12Layout
GROUP_LABEL_BAND24Layout
DEFAULT_NODE_TONEinkExport to SVG
DEFAULT_GROUP_TONEmutedExport to SVG
DEFAULT_EDGE_TONEmutedExport 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.

NameKindSource
NodeBoxtypelayout
GroupBoxtypelayout
EdgeLabelBoxtypelayout
EdgeRoutetypelayout
DiagramLayouttypelayout
GROUP_LABEL_BANDconstlayout
layoutOffunctionlayout
Pointtypelayout
Recttypelayout
LABEL_SIZEconsttext
SUB_SIZEconsttext
readingOrderfunctionreading-order
ShapePathstypeshapes
shapePathsfunctionshapes
TextLinetypeshapes
textLinesOffunctionshapes
edgeLabelLinesOffunctionshapes
edgePathfunctionshapes
arrowHeadPathfunctionshapes
dashOffunctionshapes
DiagramSvgOptionstypesvg
DEFAULT_NODE_TONEconstsvg
DEFAULT_GROUP_TONEconstsvg
DEFAULT_EDGE_TONEconstsvg
toSvgfunctionsvg

@adecore/diagram/protocol ​

The schemas and types of a diagram, migrateDiagram and diagramProblemIn. Loads Zod and the drawing protocol.

NameKindSource
DiagramShapeSchemaconstprotocol
DiagramShapetypeprotocol
DIAGRAM_SHAPESconstprotocol
DiagramDirectionSchemaconstprotocol
DiagramDirectiontypeprotocol
DiagramEdgeStyleSchemaconstprotocol
DiagramEdgeStyletypeprotocol
DiagramNodeSchemaconstprotocol
DiagramNodetypeprotocol
DiagramGroupSchemaconstprotocol
DiagramGrouptypeprotocol
DiagramEdgeSchemaconstprotocol
DiagramEdgetypeprotocol
DiagramMetaSchemaconstprotocol
DiagramMetatypeprotocol
DIAGRAM_VERSIONconstprotocol
DIAGRAM_LIMITSconstprotocol
DiagramContentSchemaconstprotocol
DiagramContenttypeprotocol
DiagramDocumentSchemaconstprotocol
DiagramDocumenttypeprotocol
EMPTY_DIAGRAMconstprotocol
migrateDiagramfunctionprotocol
diagramProblemInfunctionprotocol

Licenses and third-party notices are listed in each package.